Code: Select all
$sqlString = "SELECT * FROM items WHERE name LIKE '%" . $search . "%' LIMIT $offset, $rowsPerPage";
$sqlResult = mysql_query($sqlString);
$searchnumrows = mysql_num_rows($sqlResult);
$String = "SELECT * FROM items WHERE name LIKE '%" . $search . "%' ";
$Result = mysql_query($String);
$numrows = mysql_num_rows($Result);I have a field in my 'items' table called dateends and i would like to return all the auction items that havent expired. I have tried the following statement and i get no result at all. i hope someone might be able to tell me i'm going wrong. Thanks.
Code: Select all
$sqlString = "SELECT * FROM nam_items WHERE dateends > NOW() AND name LIKE '%" . $search . "%' LIMIT $offset, $rowsPerPage";
$sqlResult = mysql_query($sqlString);
$searchnumrows = mysql_num_rows($sqlResult);
$String = "SELECT * FROM nam_items WHERE dateends > NOW() AND name LIKE '%" . $search . "%' ";
$Result = mysql_query($String);
$numrows = mysql_num_rows($Result);