I am working on a profile page where you will be able to edit your - TopicsExpress



          

I am working on a profile page where you will be able to edit your profile data like first name, last name, date of birth etc. The inputs are filled with the right data from the database based on the user id that is stored in a session. The next step is to be able to edit these fields and that they will save in the database row that has the id of the session. I cant make the save work. With the code down below i get an error Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in C:\dev\www\portfolio\profile.php on line 84. line 84 contains the following code. VALUES ($input0101, $input0102, $input0103, $input0104, $input0105, $input0106, $input0107, $input0108)); I hope someone can help me :)! The code that stores the right data in the inputs. $id=$_SESSION[id]; $connect = mysql_connect(localhost, root, root, portfolio); $select_data = mysql_select_db(portfolio, $connect); $select_data = mysql_query(SELECT * FROM members WHERE `id`=$id) or die(mysql_error()); while($fetch=mysql_fetch_assoc($select_data)) { $oImgBox = $dom->getElementById(adminProfilePicture); $oImg = $dom->createElement(image); $oImg->setAttribute(src,$fetch[profilepic]); $oImgBox->appendChild($oImg); $oInput = $dom->getElementById(input0101); $oInput->setAttribute(value,$fetch[firstname]); $oInput = $dom->getElementById(input0102); $oInput->setAttribute(value,$fetch[lastname]); $oInput = $dom->getElementById(input0103); $oInput->setAttribute(value,$fetch[dateofbirth]); $oInput = $dom->getElementById(input0104); $oInput->setAttribute(value,$fetch[adress]); $oInput = $dom->getElementById(input0105); $oInput->setAttribute(value,$fetch[zipcode]); $oInput = $dom->getElementById(input0106); $oInput->setAttribute(value,$fetch[city]); $oInput = $dom->getElementById(input0107); $oInput->setAttribute(value,$fetch[country]); $oInput = $dom->getElementById(input0108); $oInput->setAttribute(value,$fetch[phone]); $oInput = $dom->getElementById(input0201); $oInput->setAttribute(value,$fetch[username]); $oInput = $dom->getElementById(input0202); $oInput->setAttribute(value,$fetch[password]); }
Posted on: Sun, 13 Jul 2014 13:13:08 +0000

Trending Topics



/div>

Recently Viewed Topics




© 2015