maximus99999
06-26-2007, 12:31 PM
$itemnames = "SELECT * FROM inventory INNER JOIN purchases ON inventory.id = purchases.item_id";
$itemnamesres = mysql_query($itemnames);
$useritems = "SELECT * FROM ".$itemnameres." WHERE session='".session_id()."'";
$useritemsres = mysql_query($useritems);
while($itemrow = mysql_fetch_assoc($useritemsres))
{
echo "<div align='center'>".$itemrow['name']."</div>";
}
Does anybody know the reason why this doesn't work?
The problem is when I want to use the result from the first statement.
$itemnamesres = mysql_query($itemnames);
$useritems = "SELECT * FROM ".$itemnameres." WHERE session='".session_id()."'";
$useritemsres = mysql_query($useritems);
while($itemrow = mysql_fetch_assoc($useritemsres))
{
echo "<div align='center'>".$itemrow['name']."</div>";
}
Does anybody know the reason why this doesn't work?
The problem is when I want to use the result from the first statement.