Making Search on DATE in MySQL with PHP

admin

Administrator
Staff member
Hi,

I've stored some date (YYYY-MM-DD) type DATE in a MySQL table.

I have the following dates in the MySQL Table :

2000-12-02
2000-12-03
2000-12-04
2000-12-05

The following code is used to select the date :



$vardate = "2000-12-02"

$query = "select * from table where stored_date like \"$vardate\""

$mysqlresult = mysql_query($query, $mysqllink);
$nbrarg = mysql_affected_rows($mysqllink);



My problem : The $nbrarg value = <!-- m --><a class="postlink" href="http://www.phpbuilder.com/board/archive/index.php/0">http://www.phpbuilder.com/board/archive/index.php/0</a><!-- m -->.

Is my Query OK, or what i'm doing wrong...

Thank's for your help.
 
Back
Top