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/deptid.php
<?php
 
/*
 * Following code will list all the products
 */
 
// array for JSON response
$response = array();
 
// include db connect class
require_once 'db_connect.php';
 
// connecting to db
$db = new DB_CONNECT();
 
// get all products from products table
$result = mysql_query("SELECT *FROM beatle_industry") or die(mysql_error());
 
// check for empty result
if (mysql_num_rows($result) > 0) {
    // looping through all results
    // products node
    $response["beatle_industry"] = array();
 
    while ($row = mysql_fetch_array($result)) {
        // temp user array
			$deptDetail = array();
            $deptDetail["db_IndLoginId"] = $row["db_IndLoginId"];
			$deptDetail["ind_id"] = $row["IndId"];
            $deptDetail["ind_name"] = $row["db_industry"];
 
        // push single product into final response array
        array_push($response["beatle_industry"], $deptDetail);
    }
    // success
    $response["success"] = 1;
 
    // echoing JSON response
    echo json_encode($response);
} else {
    // no products found
    $response["success"] = 0;
    $response["message"] = "No deptId found";
 
    // echo no users JSON
    echo json_encode($response);
}

?>