how to sell items in PHP
Posted: Thu Dec 18, 2008 4:00 pm
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...
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...
Code: Select all
<?php session_start();
if(isset($_SESSION['otherusername'])){
$db=mysql_connect('localhost', 'root', '');
$res=mysql_select_db('textgame',$db) or die(mysql_error());
$otherusername = $_SESSION['otherusername']; //"SELECT item FROM users_items WHERE username='".$Username."'";
$res=mysql_query($otherusername)or die(mysql_error());
while($row = mysql_fetch_assoc($res)){
echo $row['item'] . "<BR />";
}
}else{
echo "Sorry your not a member please join us!";
}
?>