php mysql row to json

Solutions on MaxInterview for php mysql row to json by the best coders in the world

showing results for - "php mysql row to json"
Salvatore
08 Nov 2020
1$sth = mysqli_query($conn, "SELECT ...");
2$rows = array();
3while($r = mysqli_fetch_assoc($sth)) {
4    $rows[] = $r;
5}
6print json_encode($rows);