Re: [PHP-DB] PHP query on "date" field From: Bruno Gimenes Pereti (pereti <email protected>)
Date: 10/30/01

Hi again Jason,

I think Jason Wong got the problem I missed, it's the date format. If you
tested like I sad in the last mail you already found it. When you query:

SELECT * FROM ads WHERE date = '%$date%';

you get an empty result.

So, that's the solution...

Bruno Gimenes Pereti.

> What is the format of date as defined in your database? If date is of
> type DATE or DATETIME then
>
> > $result = mysql_query ("SELECT * FROM ads
> > WHERE fname LIKE '%$fname%' AND lname LIKE
> > '%$lname%' AND phonea LIKE '%$phonea%' AND phone LIKE '%$phone%' AND
> > date LIKE '%$date%'");
>
> should be changed to:
>
> $result = mysql_query ("SELECT * FROM ads
> WHERE fname LIKE '%$fname%'
> AND lname LIKE '%$lname%'
> AND phonea LIKE '%$phonea%'
> AND phone LIKE '%$phone%'
> AND date = '$date'"
> );

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>