Use the above function to select data from mysql table and return
them as json. when used with ajax, u can use the json object to parse,
display and process.
<?php
$qry = "select id, name, address from cust ";
$ret = mysql_query("$qry",$link);
$xx = mysql_fetch_all($ret);
if($xx)
echo json_encode($xx);
?>
<?php
$qry = "select id, name, address from cust ";
$ret = mysql_query("$qry",$link);
$xx = mysql_fetch_all($ret);
if($xx)
echo json_encode($xx);
?>
0 comments:
Post a Comment