Here is mysql statement for my search_results page
It works fine when searching for a keyword, however when there is no result then it brings in a 1 row result with no data in it, just a broken image and a details link like there was an match but nothing came up. How can i have my search function redirect the page back to the search page if there is no result with a "There was no matches to your query" type message?
this is my php statement for the search
BTW what is a good intro book to to php, and an intermediate book as well?
[Hammer]
Nike Failed Slogans -- "Just Don't Do It!"
Code:
mysql_select_db($database_connCorelist, $connCorelist);
$query_corelist = sprintf("SELECT * FROM products WHERE description1 LIKE '%%%s%%' OR description2 LIKE '%%%s%%' OR description3 LIKE '%%%s%%' OR description4 LIKE '%%%s%%' OR description5 LIKE '%%%s%%' OR description6 LIKE '%%%s%%' ORDER BY productid ASC", $colname_corelist,$colname_corelist,$colname_corelist,$colname_corelist,$colname_corelist,$colname_corelist);
$query_limit_corelist = sprintf("%s LIMIT %d, %d", $query_corelist, $startRow_corelist, $maxRows_corelist);
$corelist = mysql_query($query_limit_corelist, $connCorelist) or die(mysql_error());
$row_corelist = mysql_fetch_assoc($corelist);
It works fine when searching for a keyword, however when there is no result then it brings in a 1 row result with no data in it, just a broken image and a details link like there was an match but nothing came up. How can i have my search function redirect the page back to the search page if there is no result with a "There was no matches to your query" type message?
this is my php statement for the search
Code:
if (isset($HTTP_POST_VARS['description'])) {
$colname_corelist = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['description'] : addslashes($HTTP_POST_VARS['description']);
}
BTW what is a good intro book to to php, and an intermediate book as well?
[Hammer]
Nike Failed Slogans -- "Just Don't Do It!"