fazlionline Posted June 6, 2009 Share Posted June 6, 2009 Hi all I am passing through a problem since a week; I am trying internet help but not succeeded till now • I made a database and table in MySQL through PHP. • I made a PHP form in DreamWeaver. • Through an INSERT INTO script, I inserted user data. • After a while the user felt to change some of his information • How can I update information of this user? I need the code soothing like this: Update tablename SET (name, location, email, phone number) from HTML Form into the database WHERE password and user ID on the form is same as that of password and user ID in the database Need help Link to comment https://forums.phpfreaks.com/topic/161164-php-mysql-update/ Share on other sites More sharing options...
jxrd Posted June 6, 2009 Share Posted June 6, 2009 Do exactly what you did to insert it, but in that update query you just provided. Link to comment https://forums.phpfreaks.com/topic/161164-php-mysql-update/#findComment-850458 Share on other sites More sharing options...
coupe-r Posted June 8, 2009 Share Posted June 8, 2009 Try this: UPDATE (tablename) SET name = '".$var1."', location = '".$var2."', email = '".$var3."', phone number = '".$var4."' WHERE password = '".$_SESSION['$pw']."' AND user_id = '".$_SESSION['$uid']."' Link to comment https://forums.phpfreaks.com/topic/161164-php-mysql-update/#findComment-851688 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.