我试图在mysql数据库中写一些东西我去了那个错误:
代码:
$fel = $mysqli->query("INSERT INTO deleted (uid, buy_type, prop_type, district, street, room_min, room_max, price_min, price_max, condition_type, heat_type, lift_type, parking_type, type_of_del, mikor)
VALUES ('".$mysqli->real_escape_string($letomb['uid'])."', '".$mysqli->real_escape_string($letomb['buy_type'])."', '".$mysqli->real_escape_string($letomb['prop_type'])."', '".$mysqli->real_escape_string($letomb['district'])."', '".$mysqli->real_escape_string($letomb['street'])."', '".$mysqli->real_escape_string($letomb['room_min'])."', '".$mysqli->real_escape_string($letomb['room_max'])."', '".$mysqli->real_escape_string($letomb['price_min'])."', '".$mysqli->real_escape_string($letomb['price_max'])."', '".$mysqli->real_escape_string($letomb['condition_type'])."', '".$mysqli->real_escape_string($letomb['heat_type'])."', '".$mysqli->real_escape_string($letomb['lift_type'])."', '".$mysqli->real_escape_string($letomb['parking_type']).", '".$mysqli->real_escape_string($type_of_del)."', '".$mysqli->real_escape_string($mikor)."')") or die($mysqli->error);
错误
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1', '2013-07-14 07:17:55')' at line 14
任何人都可以帮助我吗?
答案 0 :(得分:-1)
你在parking_type之后忘记了撇号。
附加:使用PDO(而不是mysqli)并绑定值