Gossamer Forum
Home : General : Perl Programming :

MySQL Error Checking

Quote Reply
MySQL Error Checking
Does anyone else agree with me that mysql error messages are utter dog turd.

Granted, you get "fairly" clear info for some errors but a lot of the time you get stuff like....

>>
MySQL said: You have an error in your SQL syntax near 'bla' at line 1.
<<

Ugh...its about as vague as you can get (and SO annoying)...why can't they implement something like perl has.
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
I find them good enough, really. It should be fairly obvious by looking at the syntax on given line what the problem is.

What MySQL does is give you an error number. You should output $DBI::err in your error messages. This gives you an error code which you can then lookup in the documentation.

- wil
Quote Reply
Re: [Wil] MySQL Error Checking In reply to
Yeah I know that but thats besides the point. I don't want to have to go and look up the error somewhere else, it should be displayed for me, or at least logged.

...ok if it is easy to tell by looking, what is causing this error:

MySQL said: You have an error in your SQL syntax near 'From VARCHAR(200) NOT NULL ,Recipient VARCHAR(200) NOT NULL ,Subject VARCHAR(2' at line 1.

Query:
CREATE TABLE PM(
ID INT(5) NOT NULL AUTO_INCREMENT,
From VARCHAR(200) NOT NULL ,
Recipient VARCHAR(200) NOT NULL ,
Subject VARCHAR(200) NOT NULL ,
PRIMARY KEY (ID)
);

Last edited by:

RedRum: Jan 21, 2002, 11:57 AM
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
> From VARCHAR(200) NOT NULL ,

From is a reserved MySQL word. Use something else as your column name.

- wil
Quote Reply
Re: [Wil] MySQL Error Checking In reply to
Precisely. Why the hell can't it just say "From is a reserved word"

Im sure it wouldn't be hard to loop through a few words to see if your table/column matches.

http://www.mysql.com/.../Reserved_words.html

Last edited by:

RedRum: Jan 21, 2002, 12:58 PM
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
I suppose so. Make a feature request for the next version. Look through the proposed ideas - maybe it's on the to-do list.

Why the downtime with wiredon.net?

- wil
Quote Reply
Re: [Wil] MySQL Error Checking In reply to
It expired on the 19th and I only renewed it today....so the DNS is screwy.
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
How "original" are those names.....flipper?....sigh...:

http://mysql.com/news/article-86.html

....and "query"...uh....and what the hell does "bob" have to do with anything.

Last edited by:

RedRum: Jan 21, 2002, 2:24 PM
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
Ah right. You giving up on the web hosting then?

- wil
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
I like MyDolph LOL.

- wil

Last edited by:

Wil: Jan 21, 2002, 2:31 PM
Quote Reply
Re: [Wil] MySQL Error Checking In reply to
>>Ah right. You giving up on the web hosting then?
<<

No thats why I renewed it ;)

I may use a different domain and design a new site though.

Last edited by:

RedRum: Jan 21, 2002, 2:35 PM
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
Yeah, now that you've got your own server there's plenty of room for a few more users I'm sure. Watch those euros roll in ;-)

- wil
Quote Reply
Re: [Wil] MySQL Error Checking In reply to
>>Yeah, now that you've got your own server there's plenty of room for a few more users I'm sure.<<

Sorry I don't understand what you are trying to say. I was on a co-located server before so there was never a space issue.

But in any case the dedicated server is for my personal use (and QooQ's) as well as for my HelpDesk site.

As for euros...they are all ready rolling in Wink ...how do you think i can afford this server as well as car insurance and my cable modem and repaying a $7500 student loan, without a part time job.

Last edited by:

RedRum: Jan 21, 2002, 5:27 PM
Quote Reply
Re: [RedRum] MySQL Error Checking In reply to
You get all your income from wiredon.net? That's great. What area of your company generates the most revenue, if you don't mind me asking?

- wil