If you see the Dropdown next to the "Refine your search here : " section…
And click on the search button you will see an error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /domains/glofamily.com/http/inner/member-discounts/index.php on line 87
Which is on this line:-
while($row = mysql_fetch_array($search)){...
As far as i’m aware it’s not recognizing the $search? Any ideas?
Well i have tried looking but cant seem to find the error… I have the following code:
Function
public function selectByCategory($category){
$sql = "SELECT * FROM tbl_discounts WHERE
deleted = 0 AND category = $category";
$result = mysql_query($sql) or mysql_error();
return $result;
}
That is not correct. String values need to be enclosed in single quotes else the parser can’t tell what words are supposed to be literal strings and what words are supposed to be part of the query syntax.
SELECT * FROM tbl_discounts WHERE deleted = 0 AND category = ‘Health & Leisure’