Garayed.com  

Go Back   Garayed.com > mySQL
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-10-2007, 06:32 PM
Willie
 
Posts: n/a
Default select statement 4.1 to 5.0 question

Hi All;

I have a weird problem that occured when I was checking compatability of 5.0
for my application. I have a working application in 4.1 and I was going to
upgrade. My Select statements don't work I name more than 6 columns thought
so this statment:
"SELECT ItemNum, descript_1, descript_3, descript_2, width , price, repeat
FROM apple_price ORDER BY sort, descript_1"
gives this error:
"ERROR: 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
'FROM apple_price ORDER BY sort, descript_1' at line 1"
If I remove 1 column from select it works. If I use "Select * From" it
works.

I can't figure out why. What am I missing?

Thanks
Willie


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-10-2007, 06:49 PM
Rik
 
Posts: n/a
Default Re: select statement 4.1 to 5.0 question

On Fri, 10 Aug 2007 20:32:30 +0200, Willie <willie@pdfsystems.com> wrote:

> Hi All;
>
> I have a weird problem that occured when I was checking compatability of
> 5.0
> for my application. I have a working application in 4.1 and I was going
> to
> upgrade. My Select statements don't work I name more than 6 columns
> thought
> so this statment:
> "SELECT ItemNum, descript_1, descript_3, descript_2, width , price,
> repeat
> FROM apple_price ORDER BY sort, descript_1"
> gives this error:
> "ERROR: 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
> 'FROM apple_price ORDER BY sort, descript_1' at line 1"
> If I remove 1 column from select it works. If I use "Select * From" it
> works.
>
> I can't figure out why. What am I missing?


'repeat' is a reserved word (it's a function). Either use `repeat` (with
backticks) or rename the column.
--
Rik Wasmus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:16 PM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.