Code: Select all
<?php
$id = $user['id'];
$counter = 0;
$invinfo = ("SELECT count(*) as total, name, stats, price, statadd, randid, type FROM inventory GROUP BY name having count(*) > 0 ");
$invinfo2 = mysql_query($invinfo) or die ("Could not select inventory");
while ($row = mysql_fetch_assoc($invinfo2)) {
$cur_item = $row['name'];
if($row['type'] == 'healing' || $row['type'] == 'revive' )
{
?>
<div>
<div align="left" class="itemleft"><?php echo $row["name"]; ?></div>
<div align="center" class="itemcenter"><?php echo $row["total"]; ?></div>
<div align="center" class="itemright">Adds: <?php echo $row["statadd"]; ?></div>
<input type="hidden" id="hidden" name="hidden" value="<?php echo $row["id"]; ?>">
<div align="left"><?php echo "<A href='battle1.php?randid=$row[randid]'?><font color='red'>Use Item" ?></a></font></div>
<br />
</div>
<?php
Code: Select all
$invinfo = ("SELECT count(*) as total, name, stats, price, statadd, randid, type FROM inventory GROUP BY name having count(*) > 0 AND $id= $user[id]");