Jump to content
MakeWebGames

Recommended Posts

Posted

Can someone help me finish this off please? I need it to show only item type 1 which is named "Cars".

Now before I get flamed let me point out that this is just a simple re-do of the inventory.php

 

<?php

include "globals.php";

if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); }

print "<h3>{$set['game_name']} User Garage</h3>
";

$inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC");

if($lt!=$i['itmtypeid'] < 2)

if ($db->num_rows($inv) == 0)
{
print "[b]You have no cars![/b]";
}
else
{
print "[b]Your cars are listed below.[/b]

<table width=95% class=\"table\" border=\"0\" cellspacing=\"1\">
<tr>
<td class=\"h\">Item</td>
<td class=\"h\">Sell Value</td>
<td class=\"h\">Total Sell Value</td>
<td class=\"h\">Links</td>
</tr>";
$lt="";
while($i=$db->fetch_row($inv))
{
if($lt!=$i['itmtypename'])
{
$lt=$i['itmtypename'];
print "\n<tr><td colspan=4>[b]{$lt}[/b]</td></tr>";
}
print "<tr><td>{$i['itmname']}";

if ($i['inv_qty'] > 1)
{
print " x{$i['inv_qty']}";
}
print "</td><td>\${$i['itmsellprice']}</td><td>";
print "$".($i['itmsellprice']*$i['inv_qty']);
print "</td><td>[[url='iteminfo.php?ID={$i[']Info[/url]] [[url='itemsend.php?ID={$i[']Send[/url]] [[url='itemsell.php?ID={$i[']Sell[/url]] [[url='imadd.php?ID={$i[']Add To Market[/url]]";

print "</td></tr>";
}
print "</table>";
}



?>
Posted

Re: [V2] Garage Mod

try changing

 

$inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC");

 

to

 

$inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} AND it.itmtypeid = 1 ORDER BY i.itmname ASC");

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...