我想要做android 用retrofit去insert資料去mysql
我用postman得到
Fatal error: Uncaught mysqli_sql_exception: 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 ''td1_laundry'('name','alamal','telepon')VALUES('','','')' at line 1 in C:\xampp\htdocs\insertData\insert.php:8
我的
<?php
include "connect.php";
$name=$_POST['name'];
$alamal=$_POST['alamal'];
$telepon=$_POST['telepon'];
$qry="INSERT INTO 'td1_laundry'('name','alamal','telepon')VALUES('$name','$alamal','$telepon')";
mysqli_query($con,$qry);
mysqli_close($con);
?>
我把td1_laundry不加單引號,(name,alamal,telepon)不加單引號也一樣錯誤訊息
看不懂哪裡不對??
試試看
$qry="INSERT INTO td1_laundry (name,alamal,telepon) VALUES ('$name','$alamal','$telepon');";
再不行就
$qry="INSERT INTO td1_laundry VALUES ('Name','Alama','Telphone');";