On 5/23/07, Greg Donald <[EMAIL PROTECTED]> wrote:

On 5/21/07, Mike Ryan <[EMAIL PROTECTED]> 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

'$today' not $today



--
Greg Donald
http://destiney.com/

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



   You're also single-quoting your SQL query.  When including a variable in
there, you should double-quote around the query string, and single-quote the
values you're seeking.

   Example:

$query = "SELECT * FROM `job listing` WHERE open >= '$today' LIMIT 0,30";

   It looks like your PHP code was generated by phpMyAdmin.... I know it
outputs data like you supplied.  Also, as a postscript, you should try not
to use table names that include a space.  If at all possible, convert `job
listing` to `job_listing` with an underscore.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Reply via email to