PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
how do i sell items in php? like text based game items..when a user has a item it goes to users_items table but i dont know how to make it so it can be sellable and add gold to the table users when a item is sold..
so far all i have is this which shows all the items the user has...i looked at the tutorial in the admins signature but it didnt help me when it comes to something like this though...
User marks item as sellable: UPDATE user_items SET sellable=true WHERE id=unique_id_of_item
Someone buys said item: UPDATE user_items SET user_id_of_owner=owner_id WHERE id=unique_id_of_item (same goes for whatever table and column the money is stored in. Update it to reflect the loss of one persons money and the gain of the others)
So, the item never gets deleted, just updated so that it now belongs to the other user. Does this make sense?