PHP, JSON, and MySQL -
PHP, JSON, and MySQL -
what easiest way retrieve info database, , convert info json string? there kind of helper class? or supposed loop through columns in dataset create json string?
sample code great
you can utilize json_encode function convert native php array or stdclass object it's corresponding json representation:
$result = $db->query('some query'); $set = array(); if($result->num_rows) { while($row = $result->fetch_array()) { $set[] = $row; } } echo json_encode($set); php mysql json
Comments
Post a Comment