File: /home/u435929562/domains/events.peacockindia.in/public_html/admin/admin_data.php
<?php
$host = 'localhost';
$user = 'u520518518_valoevent_demo';
$pass = 'Valoevent@dem0';
$db_name = "u520518518_valoevent_demo";
$mysqli = new mysqli($host, $user, $pass, $db_name);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = mysqli_connect("localhost", "u520518518_valoevent_demo", "Valoevent@dem0", "u520518518_valoevent_demo");
$result = mysqli_query($link, "SELECT * FROM qrcode where seat_no !='seat_no'");
// echo "<pre>";print_r($result);die;
/* Get the number of rows in the result set */
if( mysqli_num_rows($result) > 0 )
{
// $rc = mysqli_fetch_row($result);
$row = new stdClass();
$row->status = 200;
$row->result = "Data is fetched";
$row->data = mysqli_fetch_all($result, MYSQLI_ASSOC );
// echo "<pre>";print_r($row->data);die;
echo $myJSON = json_encode($row);
}
else{
$row = new stdClass();
$row->result = 'No data is available';
$row->status = 101;
echo $myJSON = json_encode($row);
}
$mysqli->close();
?>