I am trying to build a search page on my site.
On the search page you can search by town and/or
marina name.
On the results page I have the following code:
this brings up the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in results.php on line 15
when I do an error check it tells me
Unknown column 'Fleetwood' in 'where clause'
Fleetwood being the town I tried to search by
On the search page you can search by town and/or
marina name.
On the results page I have the following code:
Code:
$townsearch = $_POST['townsearch'];
$marinanames = $_POST['marinanamesearch'];
//Details SQL Query
$detailsquery = "SELECT * FROM marinas WHERE country = 'UK' AND town LIKE ".$townsearch." AND marinaname LIKE '%".$marinanamesearch."%' ORDER BY listingtype ASC, marinaname ASC";
$detailsresult = mysql_query($detailsquery, $connection);
$detailsnumber = mysql_num_rows($detailsresult);
this brings up the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in results.php on line 15
when I do an error check it tells me
Unknown column 'Fleetwood' in 'where clause'
Fleetwood being the town I tried to search by