Code not updating the database???

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

Post Reply
User avatar
cturner
Forum Contributor
Posts: 153
Joined: Sun Jul 16, 2006 3:03 am
Location: My computer

Code not updating the database???

Post by cturner »

Why is my code not updating the database from the form data? Can someone please tell me why this is happening and how I could fix it? Thanks in advance.
Here is my code:

Code: Select all

require "config2.php";
$email = $_POST['email'];
$newpassword = $_POST['newpassword'];
$query = "UPDATE users SET 'email'=". mysql_real_escape_string($_POST['email'])."', 'password'=".mysql_real_escape_string($_POST['newpassword']);
echo "Data has been updated.";
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

errr....you didn't execute the query! Image

mysql_query()
Post Reply