View Single Post
Old 08-27-2009, 01:32 AM   #5 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

You could use mysql_data_seek like below. Although it seems peculiar to me how you're using this.

php Code:
$c_pettype = 'horse' ; // From user.
$q = "SELECT *
        FROM t_petdata
       WHERE pettype = '$c_pettype' "
;
$q_result = mysql_query($q) or die('no data selected') ;
$q_rowarray = mysql_fetch_assoc($q_result) ;

echo "ELEMENT 1";
echo "<pre>";
print_r($q_rowarray);
echo "</pre>";

echo "using MYSQL_DATA_SEEK() here..." ;
mysql_data_seek($q_result, 0) ;

$q_rowarray = mysql_fetch_assoc($q_result)
            or die('query failed') ;
echo "SHOULD BE ELEMENT 1 AGAIN";
echo "<pre>";
print_r($q_rowarray);
echo "</pre>";
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following User Says Thank You to Wildhoney For This Useful Post:
Dave (08-27-2009)