kevin1145 Posted April 18, 2013 Share Posted April 18, 2013 hey guys this is my fist post here, so im sorry if i dont give enough info! but anyways i made (with help from a youtube tutorial) a users edit page but if i click on the update button it says it has been updated... but if i look in mysql database nothinghappend??!. i really want this to work because i love scripting with php and i dont like to give up so please help me! i have uploaded to files here. but if one of you have to see more just ask me! edit_profile.php user.inc.php Quote Link to comment Share on other sites More sharing options...
computermax2328 Posted April 18, 2013 Share Posted April 18, 2013 (edited) Hey, I am taking a look at these right now and the first thing I noticed is that your HTML form never closes and you have to give your form a action. Right now your form action is set to "" which means it is not taking any action. In this case it seems you are doing a single page submission so you action would be "edit_profile.php" Close your form and set the action and let me know what happens Edited April 18, 2013 by computermax2328 Quote Link to comment Share on other sites More sharing options...
kevin1145 Posted April 18, 2013 Author Share Posted April 18, 2013 i added like you said and still nothing happend Quote Link to comment Share on other sites More sharing options...
computermax2328 Posted April 18, 2013 Share Posted April 18, 2013 Ok strip the htmlentities() function and n12br() function from your mysql_real_escape_string(). Not sure why you are doing that. I am also looking to the use of session['uid'] in your where statement. I think that might be the problem. Quote Link to comment Share on other sites More sharing options...
kevin1145 Posted April 18, 2013 Author Share Posted April 18, 2013 i deleted the htmlentities and n12br but why do you think session['uid'] can be a problem? Quote Link to comment Share on other sites More sharing options...
computermax2328 Posted April 18, 2013 Share Posted April 18, 2013 Unless the session id is stored in the database the query is looking for something that is not in the database. Quote Link to comment Share on other sites More sharing options...
kevin1145 Posted April 18, 2013 Author Share Posted April 18, 2013 the session['uid'] is from the login page so only that users account can be edit Quote Link to comment Share on other sites More sharing options...
computermax2328 Posted April 18, 2013 Share Posted April 18, 2013 Right, but what I am saying is that the session['uid'] is not data that is stored in a database. It is just a piece of information that the server remembers in order to trace a user around the website. When they log in or they make a log in account do you give them a unique id? That would be something the query. You can't query something that is not stored in the database. Quote Link to comment Share on other sites More sharing options...
kevin1145 Posted April 18, 2013 Author Share Posted April 18, 2013 all users have a unique id. So i have to change the uid to somthing i have in the database to update them? Quote Link to comment Share on other sites More sharing options...
computermax2328 Posted April 18, 2013 Share Posted April 18, 2013 Yeah! Do you see in your fetch_user_info() function that you created? Is that $id variable the unique id that you have stored inside of your database for each individual user? If so update your users information using that id. Quote Link to comment Share on other sites More sharing options...
kevin1145 Posted April 18, 2013 Author Share Posted April 18, 2013 yes i use the $id is for the id for mysql database i will change it now i hope it works then! Quote Link to comment Share on other sites More sharing options...
computermax2328 Posted April 18, 2013 Share Posted April 18, 2013 Yeah that is what you need to use. Let me know if it works Quote Link to comment Share on other sites More sharing options...
kevin1145 Posted April 18, 2013 Author Share Posted April 18, 2013 I will and thanks for helping me out anyways! Quote Link to comment 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.