Jump to content

Updating datebase


kevin1145

Recommended Posts

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.phpFetching info...

user.inc.phpFetching info...

Link to comment
https://forums.phpfreaks.com/topic/277106-updating-datebase/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/277106-updating-datebase/#findComment-1425595
Share on other sites

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. 

Link to comment
https://forums.phpfreaks.com/topic/277106-updating-datebase/#findComment-1425600
Share on other sites

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. 

Link to comment
https://forums.phpfreaks.com/topic/277106-updating-datebase/#findComment-1425678
Share on other sites

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. 

Link to comment
https://forums.phpfreaks.com/topic/277106-updating-datebase/#findComment-1425684
Share on other sites

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.