So here is a code to fastly check characters inventory through the web.
Post form for charname input :
<form action='invent.php' method='post'>
<input type='text' class='ainput' name='charname' value='Char name' />
<input type='submit' class='abutt' name='Submit' value='Get Inventory'/>
</form>
Conect to database:
<?php
$host="localhost"; // Host name
$dusername="root"; // Mysql username
$dpassword="пароль"; // Mysql password
$db_name="stable"; // Database name
mysql_connect("$host", "$dusername", "$dpassword")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
?>
Inventory query (dowload items icons images and put to /items/ folder,):
include('connect.php');
$charname = $_POST['charname'];
$query = "SELECT * from characters WHERE char_name = '$charname'";
$result=mysql_query($query) or die ('Error:' .mysql_error());
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$accid = $row['obj_Id'];
}
$query1 = "SELECT * from items WHERE owner_id = '$accid'";
$result1 = mysql_query($query1) or die ('Error:' .mysql_error());
Echo "
<div id='topa'>$charname INVENTORY</div>
<table>
<tr><td>Item</td>
<td>Count</td>
<td>Enchant</td>
<td>Location</td>
</tr>
";
while($row = mysql_fetch_array($result1, MYSQL_ASSOC))
{
$itemid = $row['item_id'];
$count = $row['count'];
$enchant = $row['enchant_level'];
$loc = $row['loc'];
echo "
<tr>
<td><img src='items/$itemid.gif'/></td>
<td>$count</td>
<td>$enchant</td>
<td>$loc</td>
";
}
echo "</table>";
Ofc SS:
Credits to me.