Welcome to WebmasterWorld Guest from 54.205.88.118

Forum Moderators: coopster & jatar k

Using MySQL sub queries in PHP CLI

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

5+ Year Member



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

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

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

5+ Year Member



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

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

5+ Year Member



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

Milan

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

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



that would definitely do it
 

Featured Threads

Hot Threads This Week

Hot Threads This Month