HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/public_html/api.beatleanalytics.com/customer/get_product.php
<?php
/*
 * Following code will get single department details
 * A industry is identified by dept_id
 */
 
// array for JSON response
$response = array();
 
// include db connect class
require_once 'db_connect.php';
 
// connecting to db
$db = new DB_CONNECT();
 
    // get a details from beatle_products table
    $result = mysql_query("SELECT * FROM beatle_products")or die(mysql_error());
 
    if (!empty($result)) {
        // check for empty result
        if (mysql_num_rows($result) > 0) {
 
			 $response["productDetail"] = array();
			  while ($row = mysql_fetch_array($result)) {
				  
				$productDetail = array();
				$productDetail["productid"] = $row["productid"];
				$productDetail["name"] = $row["name"];
				$productDetail["points"] = $row["points"];
				$productDetail["stock"] = $row["stock"];
				$productDetail["image"] = $row["prod_image"];
				$productDetail["created_date"] = $row["created_date"];
				$productDetail["updated_date"] = $row["updated_date"];
			
				// push single product into final response array
				array_push($response["productDetail"], $productDetail);
			}
          
            // success
            $response["success"] = 1;

            // echoing JSON response
            echo json_encode($response);
        } else {
            // no product found
            $response["success"] = 0;
            $response["message"] = "No product found";
 
            // echo no users JSON
            echo json_encode($response);
        }
    }  else {
        // no industry found
        $response["success"] = 0;
        $response["message"] = "No product found.";
 
        // echo no users JSON
        echo json_encode($response);
    }

?>