34534534534555
IS-IT--Management
Hi
I am inserting a record into table: Auction, which has an auto increment field -auctionid. I then want to use this auction.auctionid in the table: Bid, how can i do this?This is my code, and what i want to do!!
TIA
| Feedback is always appreciated as this will help to further our knowledge as well |
I am inserting a record into table: Auction, which has an auto increment field -auctionid. I then want to use this auction.auctionid in the table: Bid, how can i do this?This is my code, and what i want to do!!
Code:
$query ="INSERT INTO auction
(sellerusername, isbn, status, bookcondition, buyitnow)
VALUES
('$username', '$isbn', 'open', '$bookcondition', '$buyitnowprice')";
$query1 ="INSERT INTO bid
(auctionid, bidprice, bidusername)
VALUES
(LAST_INSERT_ID(auctionid), '$startprice', '$username')";
$sql = mysql_query($query) or die("Invalid query: " . mysql_error());
$sql = mysql_query($query1) or die("Invalid query: " . mysql_error());
TIA
| Feedback is always appreciated as this will help to further our knowledge as well |