Jump to content

Desperate for help: Warning: mysql_fetch_assoc(): 7 is not a valid MySQL result


Recommended Posts

Newbie here!

I am desperate for some help on a mySQL error I have encountered.  I have a results page with a repeat region pulling records from a dB. When executed, only the first record displays, preceded by the following error:

 

"Warning: mysql_fetch_assoc(): 7 is not a valid MySQL result resource in /home/agciorg/public_html/events/2009/259/roster.php on line 151"

 

line 151 is the closing tag of the PHP do statement:

<?php } while ($row_rsWorkshopRegistrants = mysql_fetch_assoc($rsWorkshopRegistrants)); ?>

 

 

query is:

mysql_select_db($database_AGCI, $AGCI);
$query_rsWorkshopRegistrants = "SELECT * FROM users WHERE users.UserEventID = 259 ORDER BY UserLastName ASC"; //  
$rsWorkshopRegistrants = mysql_query($query_rsWorkshopRegistrants, $AGCI) or die(mysql_error());
$row_rsWorkshopRegistrants = mysql_fetch_assoc($rsWorkshopRegistrants);
$totalRows_rsWorkshopRegistrants = mysql_num_rows($rsWorkshopRegistrants);

 

Also of note is that for the single record that does display, the link to it's detail page does not work - the field containing the record ID that gets passed in the url is not coming through.

 

simplified version of the repeat region code:

<?php do { ?>
<tr>
<td>
<a href="http://www.agci.org/programs/past_workshop_participants/about_the_scientist/participant_details.php?recordID=<?php echo $row_rsWorkshopRegistrants['UserContactID']; ?>"><?php echo $row_rsWorkshopRegistrants['UserFirstName'] ?> <?php echo $row_rsWorkshopRegistrants['UserLastName'] ?></a>
</td></tr>
<?php } while ($row_rsWorkshopRegistrants = mysql_fetch_assoc($rsWorkshopRegistrants)); ?>	

 

Anyone have insight into what could be causing this?  I'm at a complete loss.

 

 

 

 

Please do not re-create posts that you already have a topic for.

 

http://www.phpfreaks.com/forums/index.php/topic,262713.0.html

 

As far as your issue elaborating on Wildteen's remarks. Somewhere in your code, whether in an include etc, the rsWorkshopRegistrants is being overwritten. Go through all your files searching for that and try and find a spot that may be overwriting the original resource.

 

EDIT:

As it goes, the code you have posted us does not show that there is or should be a problem, hence that it must lie else where in the code.

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.