//Get ID from Database
if(isset($_GET['edit_id'])){
$sql = "SELECT province.*, user.*
FROM userinner join province on
user.province_id = province.province_id
WHERE user.user_id=" .$_GET['edit_id'];
$result = mysqli_query($mysqli, $sql);
$row = mysqli_fetch_array($result);
}
สำหรับ join 2 ตาราง ผมแสดงได้ปกติครับ
แต่พอผมจะทำมากว่า 2
//Get ID from Database
if(isset($_GET['edit_id'])){
$sql = "SELECT province.*, travel .*, user.*
FROM userinner join province on
user.province_id = province.province_id
/* อันที่ 2 */
user inner join travel on
user.travel_id = travel.travel_id
WHERE user.user_id=" .$_GET['edit_id'];
$result = mysqli_query($mysqli, $sql);
$row = mysqli_fetch_array($result);
}
ERROR
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given
$sql = "SELECT province.*, travel .*, user.*
FROM user inner join province on user.province_id = province.province_id
inner join travel on user.travel_id = travel.travel_id
WHERE user.user_id=" .$_GET['edit_id'];