ورود

View Full Version : سوال: #1064 - You have an error in your SQL syntax



tehro0n
شنبه 25 آذر 1396, 21:55 عصر
من کد زیر را در لوکال هاست اجرا میکنم و هیچ مشکلی نیست اما در سرور با اینکه آپاچی و phpMyAdmin بروز تر است خطای زیر را میدهد.

Error

SQL query: http://toolsir.com/phpmyadmin/themes/dot.gif (http://toolsir.com/phpmyadmin/url.php?url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Fre fman%2F5.5%2Fen%2Fselect.html)

INSERT INTO `message` (`profile_id`,`subject`)
SELECT 1,test
WHERE
EXISTS (SELECT 1 FROM `profile` WHERE `id` = 1)
MySQL said: http://toolsir.com/phpmyadmin/themes/dot.gif (http://toolsir.com/phpmyadmin/url.php?url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Fre fman%2F5.5%2Fen%2Ferror-messages-server.html)
#1064 - 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 'WHERE
EXISTS (SELECT 1 FROM `profile` WHERE `id` = 1)' at line 3



INSERT INTO `message` (`profile_id`,`subject`)
SELECT :id,:subject
WHERE EXISTS (SELECT 1 FROM `profile` WHERE `id` = :id)