Re: Variable for search results
| From: | Ben Ramsey | Date: | Mon, 08 Nov 2004 17:41:59 +0000 |
| Subject: | Re: Variable for search results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201551@lists.php.net to get a copy of this message | ||
Stuart Felenstein wrote:
$sql.=sprintf("SELECT * FROM records WHERE Date_Sub(Curdate(), interval day) "$%s" <= PostStart")Yes, you can put the variable in right there. Read up on variables here <http://www.php.net/variables>. I'm not exactly sure what the SQL statement you have above is supposed to do, but you could just do something like this: $curdate = date('Y-m-d H:i:s'); $sql = "SELECT * FROM records WHERE '$curdate' <= PostStart;"; -- Ben Ramsey Zend Certified Engineer http://benramsey.com --------------------------------------------------- Atlanta PHP - http://www.atlphp.org/ The Southeast's premier PHP community. ---------------------------------------------------