Answers for "php mysql row to json"

PHP
-1

php mysql row to json

$sth = mysqli_query($conn, "SELECT ...");
$rows = array();
while($r = mysqli_fetch_assoc($sth)) {
    $rows[] = $r;
}
print json_encode($rows);
Posted by: Guest on December-26-2020

Browse Popular Code Answers by Language