Jump to content

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


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.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.