dtyson2000 Posted July 21, 2006 Share Posted July 21, 2006 Hi again guys.I've really been picking up a lot here. For that, I thank you! So moving along in my learning:I've made a basic system of inputting data into a database, searching that information and editing/updating that information a record at a time, where there's a need.Everything is working better than I could ever have imagined EXCEPT:When I pull a record to be updated/edited and input the changes, hit submit, the page returns me to the old data. The database is changed and I can see the changes in my search results. I guess I'm wondering if there's some sort of small command I may be missing that would reload the edit/update page with the new content.What do you think?Again, thank you for all of your help!Edit: It's probably something really basic. Sorry. Quote Link to comment https://forums.phpfreaks.com/topic/15210-update-record-return-old-info/ Share on other sites More sharing options...
treilad Posted July 21, 2006 Share Posted July 21, 2006 You need to post your code. ::) Quote Link to comment https://forums.phpfreaks.com/topic/15210-update-record-return-old-info/#findComment-61456 Share on other sites More sharing options...
dtyson2000 Posted July 21, 2006 Author Share Posted July 21, 2006 Here's the part that's processing the update:if ($ud_update){global $id;include('db_connect.inc');$query = "UPDATE inventory SET ***variables here, it's long*** WHERE id='$id'";mysql_query($query);echo "Record Updated";mysql_close();}Hope that's enough? Quote Link to comment https://forums.phpfreaks.com/topic/15210-update-record-return-old-info/#findComment-61460 Share on other sites More sharing options...
pocobueno1388 Posted July 21, 2006 Share Posted July 21, 2006 Try putting the part that is processing the update at the very top of your script. That will tell your computer to:1. first update the information.2. THEN display it to the screen.Instead of:1. First display information to the screen.2. Then update all the information.Hopefully this makes sense.So just put [code]if ($ud_update){global $id;include('db_connect.inc');$query = "UPDATE inventory SET ***variables here, it's long*** WHERE id='$id'";mysql_query($query);echo "Record Updated";mysql_close();}[/code]at the top of the whole script. Quote Link to comment https://forums.phpfreaks.com/topic/15210-update-record-return-old-info/#findComment-61532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.