nathanmaxsonadil Posted August 13, 2007 Share Posted August 13, 2007 I'm getting this error MySQL said: Documentation #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 '†when I try to run this query PRIMARY KEY ( `user_id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1CREATE TABLE `messages` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT , `from` varchar( 255 ) NOT NULL DEFAULT‘0′, `to` varchar( 255 ) NOT NULL DEFAULT‘0′, `message` longtext NOT NULL , `title` varchar( 255 ) NOT NULL DEFAULT”, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP , `read` int( 1 ) NOT NULL DEFAULT‘0′, PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 CREATE TABLE `users` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT , `username` varchar( 255 ) NOT NULL DEFAULT”, `password` varchar( 32 ) NOT NULL DEFAULT”, `name` varchar( 255 ) NOT NULL DEFAULT”, `email` varchar( 255 ) NOT NULL DEFAULT”, `ip` varchar( 255 ) NOT NULL DEFAULT”, `admin` int( 1 ) NOT NULL DEFAULT‘0′, PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 I checked it but I can't Find any error's Can someone help me? Quote Link to comment https://forums.phpfreaks.com/topic/64673-1064-you-have-an-error-in-your-sql-syntax/ Share on other sites More sharing options...
AndyB Posted August 13, 2007 Share Posted August 13, 2007 If what you posted is actually the query, I'm not in the least surprised that you got errors. It looks like a thoroughly mangled copy/paste mess. http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html ought to be mandatory reading. Check that are revise your code to avoid reserved words as table names or field names. In your table, at least to, from, and read are reserved words. Quote Link to comment https://forums.phpfreaks.com/topic/64673-1064-you-have-an-error-in-your-sql-syntax/#findComment-322487 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.