Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.