This is what I have got. It displays just one single record. Can anyone please tell me how can I retrieve multiple records from the table.
$.getJSON('getinfo.php', { id:id }, parseInfo);
function parseInfo(data) {
$('div#info').html(data.name +': '+ data.title);
}
The getinfo.php part is as follows:
$id = (isset($_GET['id']) && !empty($_GET['id'])) ? $_GET['id'] : 0;
$id = trim($id);
$result = mysql_query("SELECT * FROM tab WHERE col=\"$id\" );
while ($row = mysql_fetch_assoc($result)) {
$test[$id] = array('name' => $row["name"], 'title' => $row["title"]);
}
Many thanks in advance. DJ