navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

MySQL syntax errors

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> MySQL syntax errors
Page: [1]
 
womble

 

Posts: 5501
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
MySQL syntax errors - 11/30/2006 7:12:54   
I'm having problems with an SQL script that's throwing up MySQL "ERROR 1064" errors (using the MySQL monitor) - I've checked the reference manual and googled, and it seems to be something to do with using reserved words (with I'm not) - either that or it doesn't like the quote marks I'm using around field names. ` it likes (can't find that on my keyboard though, I'm C&Ping them from a pdf <edit>found it now!</edit>), ' it doesn't. I've tried with and without quotes around them, taking out the comments I've got in the script incase it was the comment syntax I'd messed up (that didn't make any difference), and just about every variation I can think of, and it still doesn't like it.

DROP TABLE IF EXISTS `TaxRate`;
CREATE TABLE `TaxRate` (
	`Rate` decimal(2,2) UNSIGNED NOT NULL default 'Not defined',
 	PRIMARY KEY(`Rate`)	
) TYPE = MyISAM;

The above is the only table it'll accept. All the others, which are set up more or less the same but with more fields, I get these "Error 1064" errors with.

For example, in the above script, if I replace the 3rd line with:
`FieldName` varchar(150) UNSIGNED NOT NULL default 'Not defined',
...I get the same error.

I've tried messing around with the quotes, capitalising the data type, lower-case data type (whichever data type I try I'm still getting these errors though I did get INT and TINYINT to work once). I've got the comma at the end of each phrase and semi-colon at the end of the statement...

I'm either getting something fundamentally wrong here, or the MySQL server just doesn't like me! I can't post the whole script because it's for an assignment for a course I'm doing, but has anyone got any ideas as to what could be causing this?


_____________________________

~~ "A cruel god ain't no god at all" ~~
:)
womble

 

Posts: 5501
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
RE: MySQL syntax errors - 11/30/2006 12:21:12   
Mystery solved. I'd been staring at the same code for so long I hadn't spotted the obvious...that if you have a non-numeric field as UNSIGNED, MySQL tends to get a teensy bit tetchy! :)

_____________________________

~~ "A cruel god ain't no god at all" ~~
:)

(in reply to womble)
jaybee

 

Posts: 14122
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: MySQL syntax errors - 11/30/2006 12:34:07   
So you mean I've been looking at that for the last 5 minutes for no reason whatsoever. :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to womble)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> MySQL syntax errors
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts