Re: PHP query on "date" field
| From: | Jason Wong | Date: | Tue, 30 Oct 2001 18:31:52 +0000 |
| Subject: | Re: PHP query on "date" field | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13856@lists.php.net to get a copy of this message | ||
On Wednesday 31 October 2001 01:31 am, Jason wrote:
> Here is my problem once again... =P I am wondering if I should change
> the date table to something other than date... maybe something like
> date_1? Would doing that resolve my issue, because of the fact that
> the date variable in php is function? Thanks in advance...
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'"
);
hth
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk