Re: [PHP] problems in WHERE statment
- From: davividal@xxxxxxxxxxxxxxxx (Davi)
- Date: Wed, 23 May 2007 14:24:24 -0300
Em Segunda 21 Maio 2007 16:46, Mike Ryan escreveu:
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??
Sure! =)
You must scape your PHP variables in any SQL query...
Try this:
$query="SELECT *
FROM `joblisting`
WHERE open >= '$today'
LIMIT 0,30";
HTH
--
Davi Vidal
davividal@xxxxxxxxxxxxxxxx
davividal@xxxxxxxxx
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "
Attachment:
pgp8028epSL7p.pgp
Description: PGP signature
- Prev by Date: Re: [PHP] date format from a database date field
- Next by Date: Swinging Hammers (was Re: Form Validation Issues)
- Previous by thread: Re: [PHP] problems in WHERE statment
- Next by thread: Re: [PHP] problems in WHERE statment
- Index(es):
Relevant Pages
|