xiao Posted April 20, 2008 Share Posted April 20, 2008 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in... I call it like this: if(mysql_num_rows(mysql_query($qryBehuizing)) == 0){ echo "<option>Geen producten gevonden</option>"; }else{ Query: $qryBehuizing = mysql_query("SELECT p.products_id, p.products_model, p.products_price, p.products_image, pd.products_name, pc.categories_id FROM products p, products_description pd, products_to_categories pc WHERE pc.categories_id = '".$instBC."' AND p.products_id = pd.products_id AND p.products_id = pc.products_id AND pd.language_id = '".$instT."' AND p.products_price <=50 GROUP BY pd.products_name ORDER BY p.products_price") or die(mysql_error()); What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 20, 2008 Share Posted April 20, 2008 You could start by unbundling your code so it gives better information: $qryBehuizing = " ... whatever ..."; $result = mysql_query($qryBehuizing) or die("Error ". mysql_error(). " with query ". $qryBehuizing); if (mysql_num_rows($result) == 0) { // etc } Quote Link to comment Share on other sites More sharing options...
xiao Posted April 20, 2008 Author Share Posted April 20, 2008 Didn't think that far It says: Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #6' at line 1 with query Resource id #6 Quote Link to comment Share on other sites More sharing options...
xiao Posted April 20, 2008 Author Share Posted April 20, 2008 In phpMyAdmin I get this error when inserting the query: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"SELECT p.products_id, p.products_model, p.products_price, p.products_image, pd.' at line 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.