iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > Putting it Together > Databases

Reply
 
LinkBack Thread Tools
Old December 19th, 2008, 06:00 AM   #1
New Member
 

Join Date: Dec 2008
Location: Ipswich
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 sck8000 is on a distinguished road
Unhappy MySQL UPDATE doesn't work...

I'm having a problem with the MySQL UPDATE for changing user details on my website, bronzephoenix.net . The code I'm using is:
Code:
<?php 
$biography 
$_POST['biography'];
$pass $_POST['password'];
$email $_POST['email'];
$name $_COOKIE['logged'];
 
require_once(
'Connections/bronzeph.php');
mysql_select_db($database_bronzeph$bronzeph);
$query_Recordset1 "SELECT * FROM userData WHERE name='$name'";
$Recordset1 mysql_query($query_Recordset1$bronzeph) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
 
$row mysql_fetch_array(mysql_query($query_Recordset1));
mysql_query(" UPDATE userData SET password=$pass, email=$email, biography=$biography WHERE name=$name ");
$message "Your details have been changed to:<br><br>Email: ".$row['email']."<br>".$row['password']."<br><br>".$row['biography']."";
header("Location: http://www.bronzephoenix.net/message.php?message=".urlencode($message)."");
mysql_free_result($Recordset1);
?>
It goes to the message page, but doesn't change any details. Please help!

Last edited by Aso; December 19th, 2008 at 06:23 AM..
sck8000 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 19th, 2008, 06:25 AM   #2
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: MySQL UPDATE doesn't work...

You need to quote values in your UPDATE query;
Code:
mysql_query("UPDATE userData SET password = '$pass', email = '$email', biography = '$biography' WHERE name = '$name'");
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 19th, 2008, 07:18 AM   #3
New Member
 

Join Date: Dec 2008
Location: Ipswich
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 sck8000 is on a distinguished road
Re: MySQL UPDATE doesn't work...

Quote:
Originally Posted by Aso View Post
You need to quote values in your UPDATE query;
Code:
mysql_query("UPDATE userData SET password = '$pass', email = '$email', biography = '$biography' WHERE name = '$name'");
Thanx
sck8000 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
bronze phoenix , details , mysql , php , update , user


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Mysql Update crackafaza PHP 1 November 24th, 2008 09:44 PM
MySQL UPDATE after use $uniqueID to find table row, etc jswebdev PHP 1 December 6th, 2005 09:09 AM
mysql update record djme Databases 4 November 28th, 2005 08:12 AM


Search Engine Optimization by vBSEO 3.2.0 RC8