Professional Documents
Culture Documents
PHP 1
PHP 1
PHP 1
php
header('Content-Type: application/json');
$method = $_SERVER['REQUEST_METHOD'];
switch ($method) {
case 'GET':
loadProduct();
break;
default:
break;
}
function loadProduct()
{
$host="localhost";
$username="";
$password="";
$database="";
$conn = mysqli_connect($host,$username,$password,$database);
$payload = array();
$success = true;
$failed = false;
if ($status == 0)
{
$payload['status'] = $failed;
$payload['message'] = "No Product Found!";
}
else {
echo json_encode($payload);
mysqli_close($conn);
}