Click here to Skip to main content
14,736,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i am trying to update logged in user data into existing row in mysql database but data is not updated. Here is my mysql query-
update users set text=[$_SESSION['txt'] where username=$_SESSION['myvaruser'] and password=$_SESSION['myvarpass'];
however it is only working if i set cookies instead of session and i want data should be updated when remember me checkbox not selected also. Please tell me whats wrong?
Updated 21-Aug-13 20:28pm
Ron Beyer 21-Aug-13 21:58pm
Are you escaping the strings anywhere?


update users set text=$text where username=$username and password=$password;
Pankaj Mahor 22-Aug-13 9:26am
Problem solved, thanx.
Jitendra Sabat 22-Aug-13 9:28am

$query="update users set text='".$txt."' where username='".$username."' and password='".$password."'";

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