Ok, I'm trying to make a trading program, but I can't get the script to retrieve the results. There are no apparent errors, so I'm not sure. This is the cody I have:
elseif ($action == "newest20")
{
$ti = mysql_query("SELECT * FROM el_inventory, trading WHERE trading.username='$username' AND el_inventory.itemid= trading.itemid ORDER BY trading.tradetime DESC LIMIT 1,20");
/*$t=mysql_query("SELECT * FROM trading ORDER BY tradetime DESC LIMIT 1,20");
$tit=mysql_fetch_array($t);
$ti=mysql_query("SELECT * FROM el_inventory WHERE itemid='$tit[itemid]'");*/
echo "<table border=1 bordercolor=336699 cellpadding=0 cellspacing=0 align=center>
<tr align=center>
<td width=100 align=center>
<b>Username:</b>
</td>
<td width=100 align=center>
<b>Item:</b>
</td>
<td width=100 align=center>
<b>Message:</b>
</td>
</tr>";
//displays the results
while ($time = mysql_fetch_array($ti))
{
if ($time[traderequest] == "") { $traderequest = "No request"; }
else { $traderequest = $time[traderequest]; }
echo "<tr>
<td>
<a href=profile.php?username=$time[username]>$time[username]</a>
</td>
<td>
<a href=trading.php?action=trade&tradeid=$time[tradenumber]>$time[item]</a>
</td>
<td>
$traderequest
</td>";
}
}
It just doesn't display the results on the page.