jack, help me figure out how to route this.
currently we have a store layout
in which, if players need to buy anything, the script draws data as such:
Code: Select all
$invinfo="SELECT * from store where amount > 0";
$invinfo2=mysql_query($invinfo) or die ("Could not select anything from the store.");
This is when players are trying to buy the item
Code: Select all
$iteminfo="SELECT * from store where randid='$randid'";
$iteminfo2=mysql_query($iteminfo) or die ("Could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);
After the item is being bought, we insert the item into player's inventory
Code: Select all
$itembought = "INSERT into Inventory(id, name, stats, statadd, randid, type) VALUES ('$playerid','$name','$stats','$statadd','$randid2','$type')";
mysql_query($itembought) or die ("Could not insert item into inventory!");
This is the script when players need to use the items from inventory
Code: Select all
$invinfo="SELECT * from inventory where id='$playerid'";
$invinfo2=mysql_query($invinfo) or die ("Could not locate player inventory");
I am thinking of creating a master items database, so the stores and inventory will just query the datas in one place.
but the question is, players still have to read from the inventory, in which the data has already been inserted into the database right?
so if we have a certain update on one item, say a potion, we have to change the data on the master items db and also the inventory db.
Is there a way that the inventory can mirror the data from the master items db?
I am sorry if I confuse you.