Jump to content

COME ON!! Why is this not working? vbg...


Jim R

Recommended Posts

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>';

Link to comment
https://forums.phpfreaks.com/topic/248150-come-on-why-is-this-not-working-vbg/
Share on other sites

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.