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...
cooldude832 Posted September 16, 2007 Share Posted September 16, 2007 replace $result = mysql_query ($query); with $result = mysql_query ($query) or die(mysql_error(); to see if an error is the issue Quote Link to comment Share on other sites More sharing options...
bradymills Posted September 16, 2007 Author Share Posted September 16, 2007 Yes. Here's the error. What does this mean? 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...
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.