DarkPrince2005 Posted December 14, 2009 Share Posted December 14, 2009 Can anyone tell me what \i'm doing wrong? $responded = mysql_query("select * from case_response where case_id = '".$case['Case ID']."'"); $responded_result = mysql_fetch_array($responded,MYSQL_ASSOC); $pictures = mysql_query("select * from case_pictures where case_id = '".$case['Case ID']."'"); $pdf = mysql_query("select * from case_pdf where case_id = '".$case['Case ID']."'"); $pdf_result = mysql_fetch_array($pdf,MYSQL_ASSOC); If(mysql_num_rows($pictures) = 0){ echo" <tr> <td colspan='2'>".htmlentities($responded_result['case_response_comment'])."</td> </tr> <tr> <td><table cellpadding='0' cellspacing='0' border='0'><tr>"; while($pictures_result = mysql_fetch_array($pictures,MYSQL_ASSOC)){ echo "<td><img src='".htmlentities($pictures_result['path'])."' width='150' /></td>"; } echo "</tr></table></td> </tr>"; } Link to comment https://forums.phpfreaks.com/topic/185133-checking-mysql_num_rows-result-with-if-statement/ Share on other sites More sharing options...
wildteen88 Posted December 14, 2009 Share Posted December 14, 2009 Can anyone tell me what \i'm doing wrong? Not telling us - what you're trying to do - what your code is supposed to do - what is the error(s) you're getting Link to comment https://forums.phpfreaks.com/topic/185133-checking-mysql_num_rows-result-with-if-statement/#findComment-977271 Share on other sites More sharing options...
mikesta707 Posted December 14, 2009 Share Posted December 14, 2009 you are using the assignment operator, when you should be using the comparison operator If(mysql_num_rows($pictures) = 0){ should be If(mysql_num_rows($pictures) == 0){ Link to comment https://forums.phpfreaks.com/topic/185133-checking-mysql_num_rows-result-with-if-statement/#findComment-977272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.