我有queries
加入2个表,我打算添加更多表格但是,我已经遇到了两个问题tables
$query = "SELECT * FROM info WHERE JOIN crew_rank ON info.id = crew_rank.crew_rank_id WHERE info.id = ?";
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, 'i', $_GET['id']);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $id, $full_name, $phone_number, $crew_rank,$date_of_birth,$age,$telephone_number,$vessel,$place_of_birth,$religion,$joining_date);
你能帮助我们这个query
有什么问题吗?我有这样的错误
警告:mysqli_stmt_bind_param()要求参数1为mysqli_stmt,第9行的C:\ xampp \ htdocs \ practice1 \ admin \ edit_info_docs.php中给出布尔值 (这是
mysqli_stmt_bind_param($stmt, 'i', $_GET['id']);
)警告:mysqli_stmt_execute()要求参数1为mysqli_stmt,第10行的C:\ xampp \ htdocs \ practice1 \ admin \ edit_info_docs.php中给出布尔值 (这是
mysqli_stmt_execute($stmt);
)警告:mysqli_stmt_bind_result()要求参数1为mysqli_stmt,第11行的C:\ xampp \ htdocs \ practice1 \ admin \ edit_info_docs.php中给出布尔值 (这是
mysqli_stmt_bind_result($stmt, $id, $full_name, $phone_number, $crew_rank,$date_of_birth,$age,$telephone_number,$vessel,$place_of_birth,$religion,$joining_date);
)
提前谢谢
答案 0 :(得分:0)
where
子句之前有一个冗余的join
关键字。删除它,你应该没问题:
SELECT *
FROM info
JOIN crew_rank ON info.id = crew_rank.crew_rank_id
WHERE info.id = ?