Say for example, I want to add 50 more books to a database of 100 books. How could I do it using the Update method? It is for the inventory module of the system that I'm working on.
Please help. Thanks.
Please help. Thanks.
INSERT INTO tablename SET colname = value, colname = value, ...
UPDATE tablename SET quantity = quantity+'$qty'
$quantity=$_POST["quantity"];
$query=mysql_query(SELECT fruit_id,description,quantity FROM tblFruits WHERE description = "oranges");
if($query)
{
$fruit_id = $row['fruit_id'];
$description = $row['description'];
$qty = $row['quantity'];
$qtyplus = $qty + $quantity;
$query2 = mysql_query("UPDATE tblFruits SET quantity = '$qtyplus'");
if($query2)
{
echo "update success!!!!"
}
}
}
Comment