Jump to content

[SOLVED] multiple query prob


Gnub

Recommended Posts

I have a small situation where I am attempting to update a record, then have the script return the updated info.

 

What is happening is that the Update query, is updating the first record in the table, which holds headers, something to do with a later export to a CVS file. 

So the query is updating the headers with the info the user is providing, and not the record that i specify in the query itself. 

 

The code is below.

 

Process is:

User inputs data into a previous form,

Script collects data and will do the following,

- Update the record with the data provided,

- Select the row with the updated data, and then echo the updated data on screen.

 

 

<?PHP
$sql2 = "Update `Teletext` Set Price = '$Price' , FLIGHTS = '$Flights' , ACCOM = '$Accom' , TOTAL = '$Total' WHERE Row_No = '$OrderID';";
$sql = "Select `Teletext`.*, DATE_FORMAT(`DepartureDate`, '%d/%m/%Y') AS revised_date FROM `Teletext` WHERE Row_No = '$OfferID';";

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

 

thanks in advance for any help you all provide

Link to comment
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.