Jump to content

#1064 - You have an error in your SQL syntax....


nathanmaxsonadil

Recommended Posts

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?

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.