bradymills Posted September 16, 2007 Share Posted September 16, 2007 I'm not sure what happened, but this code was working for about a month, and now it doesn't. I'm getting the error -- MySQL num_rows not valid argument. Can anyone see why this isn't working? It worked, and now it doesn't. I don't understand. $query = "SELECT photo, CONCAT(first_name, ' ', last_name) AS name, review_text, review_date, reviewerate_rate FROM wng_reviewers, reviews, reviewerate WHERE reviews.prod_id=$id AND wng_reviewers.user_id=reviews.user_id AND reviewerate.user_id=wng_reviewers.user_id AND reviewerate.prod_id=$id ORDER BY review_date DESC"; $result = mysql_query ($query); $num = mysql_num_rows($result); if ($num > 0) { //If it ran OK, display the records. echo '<table width="90%" cellspacing="0" cellpadding="3" align="center">'; while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { echo '<tr> <td width="50" style="padding-right: 10px;"><img src="reviewerspanel/uploads/'.$row['photo'].'" width="50" /></td> <td><span style="font-size: 10px; font-weight: bold;">'.$row['name'].' gave this item a '.$row['reviewerate_rate'] . ' and said:</span><br/> '.$row['review_text'].' </tr> <tr><td> </td></tr> '; }//End of while loop echo'</table>'; }//End of query. echo' </td> <!--End reviews pull--> </td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted September 16, 2007 Share Posted September 16, 2007 It means something is wrong with your query. Do this: $result = mysql_query ($query)or die(mysql_error()); That will tell you whats wrong with it. Quote Link to comment Share on other sites More sharing options...
bradymills Posted September 16, 2007 Author Share Posted September 16, 2007 Here's what I got. I'm not sure what this means? Is my database f'd? Can't create/write to file '/tmp/#sql_3a2a_0.MYI' (Errcode: 30) Quote Link to comment Share on other sites More sharing options...
bradymills Posted September 16, 2007 Author Share Posted September 16, 2007 Well, here's an update. I added portions of my select statement and tested, little by little. Seems the ORDER BY clause was throwing everything out of whack. This worked about a week ago, perfectly. So, temporarily, I have removed the ORDER BY and it seems to work fine. Of course, now it's not in the order I'd like. Any ideas? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 18, 2007 Share Posted September 18, 2007 So what do you have now? what error do you get when you add back the order by? Quote Link to comment Share on other sites More sharing options...
jaymc Posted September 19, 2007 Share Posted September 19, 2007 Out of disk space on /tmp? Ive had that before Google the error code 30, it will tell you why its kicking up a fuss 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.