$sth = mysql_query("SELECT ...");
$rows = array();
while($r = mysql_fetch_assoc($sth)) {
$rows[] = $r;
}
print json_encode($rows);
The function json_encode needs PHP >= 5.2 and the php-json packageRecent Posts
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment