My database is not updating when I click the submit button.
Here is the code (I already have the database connection code):
<?php
if(isset($_POST['submit']))
{
$product_add=$_POST['product_add'];
$add_item=$_POST['add_item'];
$get = mysql_query("SELECT * FROM stock WHERE item='$product_add'");
$row = mysql_fetch_array($get);
$qty_left = $row['qty_left'];
$qty = $add_item + $qty_left;
mysql_query("UPDATE stock SET qty_left='$qty' WHERE item='$product_add'") or die(mysql_error());
}
?>
Product Name
"; while ($select_query_array= mysql_fetch_array($select_query_run) ) { echo ""; } echo ""; ?> – user3501563 Apr 05 '14 at 16:23
– user3501563 Apr 05 '14 at 16:24