View Full Version : Using a mysql resource with multiple functions

02-25-2007, 09:58 PM

I would like to be able to query a database once. and use the result multiple times between functions. The $query; variable works fine the first time but dies after i try to use another function with the same $query; variable.

$db = new MYSQL();
$sql = "SELECT * FROM games WHERE result='u' ORDER BY game_id DESC";
$query = $db->Query($sql);
DisplayAll($db, $query);
echo '<p>';
ShowAT($db, $query);

any suggestions?

02-25-2007, 10:11 PM
Perhaps you might have to move the internal pointer back to the beginning?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum