JChilds Posted June 9, 2010 Share Posted June 9, 2010 Hi all, I have been stuck on this for ages and have no idea what is wrong. Nothing is happening (iin the database) Here is the doce <?php $host="localhost"; $username="root"; $password=""; $db_name="TMT"; // Reusable connection for my own sanity: // Establish database link $mysql_twtamer = mysql_connect($host, $username, $password) or die ("Cannot make the connection"); mysql_select_db($db_name, $mysql_twtamer) or die ("Cannot connect to the database"); mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select db"); $barcode = $_POST['Barcode']; $description = $_POST['Description']; $code = $_POST['Code']; $previous_price = $_POST['Previous_Price']; $invoice_price = $_POST['Invoice_Price']; $qty_ordered = $_POST['Qty_Ordered']; $qty_delivered = $_POST['Qty_Delivered']; echo $barcode."<br>"; echo $code."<br>"; echo $description."<br>"; echo $qty_delivered."<br>"; echo $invoice_price."<br>"; mysql_query("INSERT INTO items(Barcode, Code, Description, Qty, Price) VALUES('$barcode', '$code', '$description', '$qty_delivered', '$invoice_price'"); $new_qty = $i - $qty_delivered; mysql_query("UPDATE invoices SET qty = $new_qty WHERE qty=$i AND code=$code"); ?> Link to comment https://forums.phpfreaks.com/topic/204248-mysql_query-not-doing-anything/ Share on other sites More sharing options...
mrMarcus Posted June 9, 2010 Share Posted June 9, 2010 add trigger_error(mysql_error()); to end of mysql_query()'s Link to comment https://forums.phpfreaks.com/topic/204248-mysql_query-not-doing-anything/#findComment-1069752 Share on other sites More sharing options...
kailas Posted June 9, 2010 Share Posted June 9, 2010 can u prescribe u r issue in more details..... Link to comment https://forums.phpfreaks.com/topic/204248-mysql_query-not-doing-anything/#findComment-1069851 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.