Gnub Posted February 19, 2007 Share Posted February 19, 2007 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 https://forums.phpfreaks.com/topic/39157-solved-multiple-query-prob/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.