Sir suddenly I am facing this error message
and php file has these codes
<?php
date_default_timezone_set("Asia/Karachi");
$tstamp = date('Y-m-d H:i:s');
//--------------------------------------------------------------------------
$client_ip = $_SERVER['REMOTE_ADDR'];
$mac_address = exec('getmac');
$mac_address = strtok($MAC, ' ');
//echo $mac_address;
//--------------------------------------------------------------------------
// database credentials
//--------------------------------------------------------------------------
$servername = "localhost";
$username = "id20649282_hassan";
$password = "Tariq@123456";
$database = "id20649282_asiacng";
$dbc = mysqli_connect($servername, $username, $password, $database);
if (!$dbc) {
die("DATABASE CONNECTION FAILED:" . mysqli_error($dbc));
exit();
}
//--------------------------------------------------------------------------
// variables
//---------------------------------------------------------------------------
$datex = mysqli_real_escape_string($dbc, $_GET["date"]);
$button = mysqli_real_escape_string($dbc, $_GET["button"]);
// echo $button;
//-------------------------------------------------------------------------------------
// DAILY purchase
//-------------------------------------------------------------------------------------
// on screen initilize
if ($button =="btn_stock_pet") {
$query = "Select data.ddate,
SUM(ifnull(data1.opening+data1.P_Pur-data1.P_sal,data.opening)) As opening,
data.P_Pur As p_ltr,
data.P_sal As P_sal,
SUM(ifnull(data1.opening+data1.P_Pur-data1.P_sal,data.opening))+(data.P_Pur-data.P_sal) As closing
FROM (
Select ddate, Sum(p_ltr) As opening, 0 As P_Pur,0 As P_sal
FROM master1 Group By ddate
union All
SELECT ddate, 0 As opening, Sum(p_ltr) As P_Pur,0 As P_sal From purchase Group By ddate
UNION All
SELECT ddate, 0 As opening, 0 As P_Pur,Sum(p_ltr) As P_sal From sales Group By ddate)
As data
LEFT Join (
Select ddate, Sum(p_ltr) As opening, 0 As P_Pur,0 As P_sal FROM master1 Group By ddate
union All
SELECT ddate, 0 As opening, Sum(p_ltr) As P_Pur,0 As P_sal From purchase Group By ddate
UNION All
SELECT ddate, 0 As opening, 0 As P_Pur,Sum(p_ltr) As P_sal From sales Group By ddate)
as data1
On data1.ddate < data.ddate
GROUP By data.ddate,data.P_Pur,data.P_sal";
$hacer = mysqli_query($dbc, $query);
$numColumns = mysqli_field_count($dbc);
if ($numColumns > 0) {
$en_csv = '';
while ($row = mysqli_fetch_assoc($hacer)) {
foreach ($row as $column) {
$en_csv .= $column . ",";
}
$en_csv = rtrim($en_csv, ",");
$en_csv .= "\n";
}
$en_csv = rtrim($en_csv, "\n");
print $en_csv;
}
mysqli_close($dbc);
}
?>
Sir what kind of issue is this?
Please help