Search
 
SCRIPT & CODE EXAMPLE
 

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);
Comment

PREVIOUS NEXT
Code Example
Php :: laravel model bind with route in model 
Php :: ? in php 
Php :: assign multiple variables php 
Php :: php stristr 
Php :: php query 
Php :: how to install mysql and phpmyadmin on windows 10 
Php :: change email to username laravel login 
Php :: php catch mysqli_connect(): (HY000/1045): Access denied 
Php :: phpunit/phpunit[6.0.0, ..., 6.5.14] require php ^7.0 - your php version (8.0.0) does not satisfy that requirement. 
Php :: php oop crud database 
Php :: how to refresh migration in laravel without losing data 
Php :: how to save array of inputs in php 
Php :: export txt php 
Php :: php izyboy 
Java :: java get appdata path 
Java :: java enum get nex 
Java :: console log java 
Java :: isprime check formula java 
Java :: java arraylist 
Java :: Share application “link” in Android 
Java :: javafx tableview remove all rows 
Java :: ranfom number between 1 to 100 java 
Java :: android round double to 2 decimal 
Java :: array to map java7 
Java :: format localdatetime 
Java :: guess the number java 
Java :: java get monitor size 
Java :: java bubble sort 
Java :: android manifest internet permission 
Java :: java show error dialog 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =