Re: problems in WHERE statment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/21/07, Mike Ryan <miker@xxxxxxxxxxxxxx> wrote:
I am a newbie so please bear with me.

I get this error message when I try to run a query

Connected successfullyCould not successfully run query () from DB: Unknown
column '$today' in 'where clause'

this is the query command
 $query = 'SELECT *
FROM `job listing`
WHERE open >=$today
LIMIT 0 , 30 ';

I have assigned $today this way $today=date("Y-m-d");

Can you tell me what I did wrong??

thanks for your help.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Single quotes in PHP do not evaluate their contents.  Double quotes
do.  So $today is literally $today instead of the value you set in it.

$hi = "Hi";

echo '$hi';
output: $hi

echo "$hi";
output: Hi

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux