Hi all, I have a table called items here is a dump:
CREATE TABLE items ( id int(10) NOT NULL auto_increment, name varchar(50) NOT NULL default '', item_type int(4) NOT NULL default '0', image varchar(100) NOT NULL default '', price int(10) NOT NULL default '0', quantity int(5) NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM; Here is my code and I know there has to be an easier way to do this so any help would be appreciated. <form action="buyitem.php" method="post"> <?php // selects the image of the item from db $query = "SELECT image FROM items where id = 1"; $ret = mysql_query($query); while(list($image) = mysql_fetch_row($ret)) echo "<input type=image src=images/blueholo.gif name=\"1\"><BR>"; //select the name of the item $query = "SELECT name FROM items where id = 1"; $ret = mysql_query($query); while(list($name) = mysql_fetch_row($ret)) echo "<B>$name</B>"; //shows the quantity of the item $query = "SELECT quantity FROM items where id = 1"; $ret = mysql_query($query); while(list($quantity) = mysql_fetch_row($ret)) echo "Quantity $quantity<BR>"; //the price of the item $query = "SELECT price FROM items where id = 1"; $ret = mysql_query($query); while(list($price) = mysql_fetch_row($ret)) echo "Cost: $price SC"; ?> </form> What I am trying to do is make it so the user clicks on the image and is taken to buyitem.php through the form where it takes the item out of the items table and updates the user table with that item. Any ideas how I can accomplish this? TIA Jennifer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php