Re: [PHP] Question about passing date in sql...
On Wed, August 1, 2007 5:00 pm, Michael Preslar wrote: I know it has to do with date='`date +%Y%m%d`', because if I remove it works. Are you trying to use perl's back tic operator in php here? Close. He's trying to use the shell's back tick operator in MySQL. I think. It would actually work if the `date +%Y%m%d` was outside of the quotes he is wrapping around his query, as then he'd be using PHP's backticks operator which is very much like a shell backticks operator. Though using PHP date() function, as already suggested, would be MUCH faster. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about passing date in sql...
Stut wrote: Michael Preslar wrote: I know it has to do with date='`date +%Y%m%d`', because if I remove it works. Are you trying to use perl's back tic operator in php here? PHP also supports the that. However, I think the OP's problem is that it's inside other quotes and is therefore not being executed. But, as someone else pointed out, you should be using the PHP date function to get the date from within PHP. -Stut Not perl, bash! Well, what I was trying to do was covert my bash script to php, my sql statement makes the call to date so that it puts today date, that all it doing. I will look around and see if I can do that with php. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about passing date in sql...
Payne wrote: Stut wrote: Michael Preslar wrote: I know it has to do with date='`date +%Y%m%d`', because if I remove it works. Are you trying to use perl's back tic operator in php here? PHP also supports the that. However, I think the OP's problem is that it's inside other quotes and is therefore not being executed. But, as someone else pointed out, you should be using the PHP date function to get the date from within PHP. -Stut Not perl, bash! Well, what I was trying to do was covert my bash script to php, my sql statement makes the call to date so that it puts today date, that all it doing. I will look around and see if I can do that with php. Thanks. Guys, thanks for the help got it, if I switch to current_date with is build into mysql that does what I was doing anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about passing date in sql...
Guys, Got a quick question. I got a sql statement works when I pass it from the cli. but if I try in php I get nothing. This is the statement. Select ip, date, time, CONCAT(city, ', ',country) as location from ips where country !=' ' and date='`date +%Y%m%d`' order by country asc; I know it has to do with date='`date +%Y%m%d`', because if I remove it works. Any clue as to why? Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about passing date in sql...
Payne wrote: Guys, Got a quick question. I got a sql statement works when I pass it from the cli. but if I try in php I get nothing. This is the statement. Select ip, date, time, CONCAT(city, ', ',country) as location from ips where country !=' ' and date='`date +%Y%m%d`' order by country asc; I know it has to do with date='`date +%Y%m%d`', because if I remove it works. Any clue as to why? Payne why not use the PHP function to format the date? http://www.php.net/date -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about passing date in sql...
I know it has to do with date='`date +%Y%m%d`', because if I remove it works. Are you trying to use perl's back tic operator in php here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about passing date in sql...
Michael Preslar wrote: I know it has to do with date='`date +%Y%m%d`', because if I remove it works. Are you trying to use perl's back tic operator in php here? PHP also supports the that. However, I think the OP's problem is that it's inside other quotes and is therefore not being executed. But, as someone else pointed out, you should be using the PHP date function to get the date from within PHP. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about the date
Hello, I have a question about the date. I have a script that compose an e-mail and send it. No problem until now, but I also need that the script can write the date of the next week. Let say we are Wednesday. The script must write the date of Wednesday 3rd in the e-mail. But from 5pm today, it needs to change it and write Wednesday 10th November. Same for every week. How to do that? Thank you very much for your help. Vous manquez despace pour stocker vos mails ? Yahoo! Mail vous offre GRATUITEMENT 100 Mo ! Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php