risestar
-
Posts
5 -
Joined
-
Last visited
Never
Posts posted by risestar
-
-
I think so. Are you talking about something like a mysql_num_rows?
-
http://www.quadcorral.com/placestoride/directory/United_States/United_States.html is the page
Yes, that is the problem, it is grabbing rows for the individual listings, but the main categories, which have no shortdescriptions, of course have no rows to grab. So I need to either refine a way to grab only rows from the individual listings or a way to filter out the main and subcategories
As you can see, its looking for rows in the main categories, which there are none, but if you click on a category, you will see the individual listings which have rows
-
As recommended on another forums i tried
$sql="select shortdescription from links where category = '".$scat->id."' ";
$result=mysql_query($sql) or die(mysql_error());
$row=mysql_fetch_row($result);
$shortdesc = array_shift($row);
but it did not make a difference, same error.
-
I am having some problems getting a query correct. Basically I have two tables, one with listings and another with categories. In the listings table I have a column called shortdescription.
I am trying to pull the shortdescription from the listings table with the query
$shortdesc = array_shift(mysql_fetch_row(mysql_query("select shortdescription from links where category = '".$scat->id."' ")));
The shortdecription display properly on the pages display the listings, however I am getting the following error on any pages that only display the parent categories
Warning: array_shift() [function.array-shift]: The argument should be an array in /home/...path/file.php on line 1462
The listings id numbers begin at 75+ because the initial parent category id ends at 74. The query seems to be searching for listing ids below 75 and spitting out an error because it is not finding them.
Any ideas on how to eliminate this error and/or stop the query from looking for non-existant data?
Warning: array_shift() [function.array-shift]: The argument should be an array i
in PHP Coding Help
Posted
No the problem is that it's trying to pull rows when there aren't any