Jim R Posted September 30, 2011 Share Posted September 30, 2011 I mean come on. It's going to be some comma or misplaced period. I"m getting the following error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/jwrbloom/public_html/metroindybasketball.com/resources/11league.php on line 28 Line 28 is the WHILE statement. : ( $query = 'SELECT * FROM fallLeague10 WHERE confirm = "y" ORDER BY team,feet DESC,inches DESC,nameLast'; $results = mysql_query($sql) or trigger_error('MySQL error: ' . mysql_error()); $currentTeam = false; while($line = mysql_fetch_assoc($results)) { if($currentTeam != $line['team']) { //Status has changed, display status header $currentStatus = $line['team']; echo '<tr><td colspan="6"><hr></td></tr>'; } echo '<tr> <td></td> <td><b>' . $line['nameFirst'] . ' ' . $line['nameLast'] . '</b></td> <td><center>'. $line['feet'] . '\'' . $line['inches'] . '"</center></td> <td><center>'. $line['grade'] . '</center></td> <td>'. $line['school'] . '</td>'; echo '<td><b>'. $line['college'].'</b></td>'; echo '</tr>';} echo '</tbody></table>'; Quote Link to comment https://forums.phpfreaks.com/topic/248150-come-on-why-is-this-not-working-vbg/ Share on other sites More sharing options...
Pikachu2000 Posted September 30, 2011 Share Posted September 30, 2011 There should be an error showing up in your error log, no? Quote Link to comment https://forums.phpfreaks.com/topic/248150-come-on-why-is-this-not-working-vbg/#findComment-1274247 Share on other sites More sharing options...
Jim R Posted September 30, 2011 Author Share Posted September 30, 2011 It doesn't show an error. Here is the page: http://metroindybasketball.com/fall-league-2011/ Quote Link to comment https://forums.phpfreaks.com/topic/248150-come-on-why-is-this-not-working-vbg/#findComment-1274248 Share on other sites More sharing options...
PFMaBiSmAd Posted September 30, 2011 Share Posted September 30, 2011 The variable you are forming the query in and the variable you are putting into the mysql_query() statement are not the same. What trigger_error() reports and displays/logs is dependent on the error_reporting and display_errors/log_errors settings. When developing and debugging php code, you should always have error_reporting set to E_ALL and display_errors set to ON. You would have been (likely) getting an undefined variable error on the variable being put in the mysql_query() statement and an 'empty query' error from the trigger_error statement. Quote Link to comment https://forums.phpfreaks.com/topic/248150-come-on-why-is-this-not-working-vbg/#findComment-1274250 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.