Jump to content

[SOLVED] multiple sql's only 1 being carried out...


Gnub

Recommended Posts

Hello, i've written a script, where the data on a form, on a previous page, is sent to a .php script.  That script then updates the table, and will generate a table with the updated data, which is done on a seperate query, for validation.

 

The update should happen before the data is shown, as it is written below.  However, the return data doesn't show the updated, but the old data in the table.  When looking at the table manually, it displays the old data. as if the update did not happen.

 

Can someone check to see if everything as it should be?

 

Thanks in advance.

 

Code:

 

$OfferID = $_POST["OfferID"];
$Price = $_POST["Price"];
$Flights = $_POST["FLIGHTS"];
$Accom = $_POST["ACCOM"];
$Total = $_POST["TOTAL"];
$ChangedBy = $_POST["Changed"];

$sql2 = "Update `Teletext` Set `Offer ID` = '$ChangedBy', Price = '$Price', FLIGHTS = '$Flights', ACCOM = '$Accom', TOTAL = '$Total' WHERE Row_No = '$OfferID';";
$sql = "Select `Teletext`.*, DATE_FORMAT(`DepartureDate`, '%d/%m/%Y') AS revised_date FROM `Teletext` WHERE Row_No = '$OfferID';";
$db = mysql_connect("", "", "");
mysql_select_db("",$db);

$result2 = mysql_query($sql2,$db) or die(mysql_error());
$result = mysql_query($sql,$db) or die(mysql_error());

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.