PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
krraleigh
Forum Commoner
Posts: 86 Joined: Tue Jul 17, 2007 2:52 pm
Post
by krraleigh » Mon Jul 30, 2007 7:53 pm
Can anyone tell me what the problem with this update statment is:
Code: Select all
$userName = mysql_real_escape_string($userName);
$myPass = mysql_real_escape_string($myPass);
$myEmail = $_POST['email'];
$myEmail = mysql_real_escape_string($myEmail);
UPDATE user //line 37
SET username = $userName, pass = $myPass
WHERE email = $myEmail;
I have this error:
Parse error: syntax error, unexpected T_STRING in G:\xampp\htdocs\bethel\1purpose_bethel\forgotPass.php on line 37
Thank You
Kevin
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Jul 30, 2007 8:04 pm
It's not in quotes... being assigned to a variable... Not hashed password...
krraleigh
Forum Commoner
Posts: 86 Joined: Tue Jul 17, 2007 2:52 pm
Post
by krraleigh » Mon Jul 30, 2007 8:14 pm
I get the hashed password, "woops"...
However can you be a little more specific, I don't understand what your saying?
It's not in quotes... being assigned to a variable
I tried this but...
Code: Select all
$userName = mysql_real_escape_string($userName);
$myPass = mysql_real_escape_string($myPass);
$myEmail = $_POST['email'];
$myEmail = mysql_real_escape_string($myEmail);
UPDATE user
SET username = '$userName', pass = '$myPass'
WHERE email = '$myEmail';
Kevin
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Jul 30, 2007 8:18 pm
The query must be in a string or PHP will assume you're attempting to tell it to execute PHP code .. and it won't understand a single word of it.
krraleigh
Forum Commoner
Posts: 86 Joined: Tue Jul 17, 2007 2:52 pm
Post
by krraleigh » Mon Jul 30, 2007 8:25 pm
I did a search and every example I found showed me what I have.
Can you show me what it should look like?
Thank You
Kevin
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Jul 30, 2007 8:27 pm
krraleigh
Forum Commoner
Posts: 86 Joined: Tue Jul 17, 2007 2:52 pm
Post
by krraleigh » Mon Jul 30, 2007 8:33 pm
thank you
Kevin