HOME > PHP > PHP Forum > สอบถาม error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax
สอบถาม error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT0,5' at line 3
Code (PHP)
$per_page=5;
$page = isset($_GET['page'])? $_GET['page'] : 1;
$st_rec = ($page - 1) * $per_page;
$sql = "SELECT * FROM number WHERE type = '$strid' and user = '$_SESSION[login_true]'
ORDER BY num ASC LIMIT" .$st_rec.',' . $per_page;
$query = $conn->query($sql) or die($conn->error."<br>$sql");
สอบถามด้วยครับของผมก็ error แบบนี้แก้ไม่ได้เลยอะครับ ลองแก้ตามเเล้ว
Query does not work.You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'does not work.You have an error in your SQL syntax; check the manual that cor...' at line 1
Code (PHP)
$b = 1;
$sql ="UPDATE New_car_car_reservation SET placego =$a WHERE vehicle_id = $b
and now()
and status = 1
order by id desc limit 1";
$b = 1;
$sql ="UPDATE New_car_car_reservation SET placego =$a WHERE vehicle_id = $b
and now()
and status = 1
order by id desc limit 1";
die($sql); // เพิ่มบันทัดนี้เพื่อนทดสอบ เมื่องใช้งานจริง ลบบันทัดนี้ออก
// แล้วเอาผลลัพท์มาให้ดูหน่อย