Everything is perfect except for the table, which is actually world_users. Upon fixing that, it worked perfectly! This method could be used for adding, subtracting(with negatives), and transferring money. Excellent...
Something else you could do would be to code the user owned shop module-thingy. This is more advanced and requires knowledge of how items work in Aard. A user's or shop's inventory is represented by a string of numbers seperated by dashes. Each number is the ID of an item in the user's shop. By using the explode() method with - as the delimiter, you get an array of the items, which can then be displayed with a loop. Each item's description and actions associated with it can be viewed at item.php?id= and the item's id. The image of the item is at images/items/(id of the item).png. A user's shop should display the items in it (shopinv from the world_users table) and have each pop up a yes/no dialog for purchase. The price of the item (price from world_items table) would then be subtracted from the user's cash at hand (money) and added to the shop's till (shoptill from world_users). The obstacle here is removing items from the array of items and parsing it back into a string without nulls. I was lazy when I attempted this and instead coded the player inventory display.
For reference, here is that code:
<?php
include 'dbcnx.php';
include 'check_login.php';
if (!$logged_in) {
echo '<p>You are not logged in, fool! Log in now!</p>';
} else {
$invlist = "";
$sql = "SELECT inventory FROM world_users WHERE username = '".$uname."'";
$inv = mysql_result(mysql_query($sql), 0);
$inventory = explode("-", $inv);
for ($i=0; $i < count($inventory); $i++) {
$invlist .= " <a href='javascript:window.Open('http://www.zifos.com/aard/item.php?id=$inventory[$i]','MyWindow','toolbar=no,menubar=no,scrollbars=yes,resizable=no,width=200,height=400')'><img src='images/items/$inventory[$i].png'></a>";
}
echo "<h1>Your Pockets Have in Them:</h1><br><br>";
echo $invlist;
}
?>
At the top, dbcnx.php connects to my database, check_login.php contains all player variables, and aardfuncs.php contains functions. (Currently, only the addmoney.)
A problem I had with the inv.php was getting item descriptions to pop up. I will post this in the forum later, unless you know what I screwed up.