homepage Welcome to WebmasterWorld Guest from 54.196.225.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Using MySQL sub queries in PHP CLI
milanmk




msg:3400022
 2:45 pm on Jul 20, 2007 (gmt 0)

I am using a sub query like the following in a cron file and its throwing a query error.

...eexpiry = (CURDATE() + INTERVAL (SELECT alert2 FROM settings) DAY)...

Does that mean I cant use sub queries in PHP CLI?

Milan

 

jatar_k




msg:3400043
 3:03 pm on Jul 20, 2007 (gmt 0)

what is the exact error it gives you?

have you tried the query you are trying to run from the command line?

milanmk




msg:3400242
 6:26 pm on Jul 20, 2007 (gmt 0)

The error shown is:-

#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 'SELECT alert2 FROM settings ) DAY )

I cant try it on CLI on server as its a shared hosting environment. I have a testing setup on Windows at my place where i will try it and let you know.

Milan

milanmk




msg:3400444
 10:49 pm on Jul 20, 2007 (gmt 0)

Oh my host uses MySQL version 4.0.27-standard and sub queries are only supported from 4.1 onwards!

Milan

jatar_k




msg:3400822
 1:39 pm on Jul 21, 2007 (gmt 0)

that would definitely do it

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved