<?php
if (isset($_GET['id'])) {
$sql = "SELECT id, description, msrp FROM tbl WHERE id = '{$_GET['id']}'";
$return = array();
if ($result =
mysql_query($sql)) {
if (mysql_num_rows($result)) {
$return['msg'] = 'success';
while ($row = mysql_fetch_assoc($result)) {
$return['data'][] = $row;
}
} else {
$return['msg'] = 'No results found';
} else {
$return['msg'] = 'Query failed';
}
header("Content-type: application/json");
echo json_encode($result);
}