Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php mysql row to json

$sth = mysqli_query($conn, "SELECT ...");
$rows = array();
while($r = mysqli_fetch_assoc($sth)) {
    $rows[] = $r;
}
print json_encode($rows);
 
PREVIOUS NEXT
Tagged: #php #mysql #row #json
ADD COMMENT
Topic
Name
5+1 =