Converting Data From MySQL to JSON Using PHP

preview_player
Показать описание
This video will show you how to convert data from mysql to json using php.

Download Link's :

PHP Code :

$connect = mysqli_connect("localhost","root","1234","youtube");
$sql = "select * from demo";

$result = mysqli_query($connect,$sql);

$json_array = array();

while($row = mysqli_fetch_assoc($result))
{
$json_array[] = $row;
}

echo json_encode($json_array);

Video Link for using XAMPP :

LIKE & SUBSCRIBE
Рекомендации по теме
Комментарии
Автор

hi
how can we do the same process for multiple tables
i mean more than one tables of mysql to one json object

majormfr