nelson222 — 2010-07-23T12:14:22-04:00 — #1
Changed to Php5.3 and receiving these warning messages,
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\wamp\www\050505\fnc2.php on line 322
I think it's saying that ($sql_res) needs to be a resource and not a boolean on line 322.
// This function return how many ads exist in the specified category
global $cat_fields, $table_ads, $page, $adsonpage;
$sql_query="select count(idnum) from $table_ads where
catname='$ct' and visible=1";
$row=mysql_fetch_row($sql_res); // line 322
How do I create a resource from this boolean?
Thanks for your replies,:)
jaanboy — 2010-07-23T12:33:28-04:00 — #2
It means that mysql_query isn't returning a resource but instead returning false, meaning that there is an error in your sql code.
Use the following code and see what error you get:
$sql_res = mysql_query($sql_query) or die (mysql_error());
nelson222 — 2010-07-24T04:24:53-04:00 — #3
I included code on line 321 the above code and an now receiving the following message,:)
you have an error in your SQL syntax;
check the menual that corresponds to your MySQL server version for the
right syntax to use near 'where catname='Elec' and visible = 1'at line 1
zalucius — 2010-07-24T11:57:02-04:00 — #4
You have an error in your SQL query.
Echo the query, and see if you can spot the error... which is just before the "WHERE" clause.