Jump to content

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


mishasoni

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.

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.