| Welcome to WebmasterWorld Guest from 188.8.131.52 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Using MySQL sub queries in PHP CLI|
| 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?
| 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?
| 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.
| 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!
| 1:39 pm on Jul 21, 2007 (gmt 0)|
that would definitely do it
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved