for example i have two tables post table and user table, and from these i want to create a json array to pass bootstrap datatable.
My table structure. post table and user table. i want to generate an output table having post details and user details.but user name should be in drop down box.
<?php
include('config/db_i.php');
$sql_post = mysqli_query($con,"SELECT * FROM `post_tbl`");
$array = array();
$array['data'] = array();
while($res_post = mysqli_fetch_array($sql_post)){
$sql_user = mysqli_query($con,"select * from user_tbl where user_id='".$res_post['user_id']."'");
$row_user = mysqli_fetch_array($sql_user);
//what i'll code here
$array['data'][] = $res_post;
}
echo json_encode($array);
?>

