Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this code, which stores values in the text-box but when I refresh It stays but when I refresh twice the data isn't there! Is there a way I can fix this?



PHP
$username = $_SESSION[user];
$user2 = $_SESSION[user];
$user = mysql_query("SELECT * FROM ajax_chat_users WHERE userName = '$username'");
$user=mysql_fetch_assoc($user);
$merry = mysqli_query($con,"SELECT * FROM ajax_chat_users WHERE userName = '$username'");
$row = mysqli_fetch_array($merry);
$merry2 = mysqli_query($con,"SELECT * FROM ajax_chat_users WHERE userName = '$user2'");
$row2 = mysqli_fetch_array($merry2);
if($user[userRole]== "AJAX_CHAT_OWNER" && $row2[userRole]!="AJAX_CHAT_OWNER"){
die("You have insufficient privileges to view this page! <a href=Members.php>Go back to user list?</a>");
}




SQL
$update4 = mysql_query("UPDATE ajax_chat_users
                       SET AboutMe='$update0', FriendCode='$update1', CSS='$update2', NNID='$update3'
                     WHERE userName = '$user2' ");



XML
<form name=input action=edit_profile.php method=post>
<textarea name=ABOUT_ME>".$row[AboutMe]."</textarea><br>
Nintendo 3DS Friend Code:<br><input type=text name=FRIEND_CODE maxlength=12 pattern=.{12,12} value=".$row[FriendCode]."/><br>
NNID:<br><input type=text name=NNID maxlength=16 value=".$row[NNID]."><br>
CSS (Profile Styling):<br><textarea name=CSS>".$row[CSS]."</textarea><br>
<input type=submit value=\"Save Changes?\">
Posted

1 solution

are the above code on a same page ? b'coz i don't see any reason for it to not display, since it is making query everytime and will fetch the value everytime.
 
Share this answer
 
Comments
SkyeEverest 30-Sep-14 16:39pm    
Yeah they are on the same page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900