View Single Post
  #2 (permalink)  
Old May 7th, 2009, 08:46 PM
sgtwwilson sgtwwilson is offline
Registered User
 
Join Date: Apr 2009
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default misformed query...

I've figured this out...


it looks like there needs to be a join to the site_user_info table or else the entire table gets updated...

Guess this qualifies as errata.

I edited the query to look like this and it works fine now.

PHP Code:

(snip)
$query 'UPDATE 
                    site_user u JOIN site_user_info i ON u.user_id = i.user_id 
                SET
                    username = "' 
mysql_real_escape_string($username$db) . '",
                    first_name = "' 
mysql_real_escape_string($first_name$db) . '",
                    last_name = "' 
mysql_real_escape_string($last_name$db) . '",
                    email = "' 
mysql_real_escape_string($email$db) . '",
                    city = "' 
mysql_real_escape_string($city$db) . '",
                    state = "' 
mysql_real_escape_string($state$db) . '",
                    hobbies = "' 
mysql_real_escape_string(join(', '$hobbies), $db) . '"
                  WHERE
                    u.user_id = ' 
$user_id
Reply With Quote