Page 1 of 1

User Profile Edit Script, Update Script PHP

Posted: Thu Mar 10, 2005 10:22 pm
by redzonne
Does anyboby know how to put together a user profile edit script.

I inserted the below code in my edit profile page. It doesn't actually update the database though. I think I'm missing a piece.

Code: Select all

mysql_select_db('realest1_proppost');
  $query2 = "UPDATE customerindex SET cfirstname='$cfirstname', clastname='$clastname', cmidinitial='$cmidinitial', cstaddress='$cstaddress', cunitnum='$cunitnum', ccity='$ccity', czip='$czip', cphone='$cphone', cfax='$cfax', cemail='$cemail' WHERE login='$login', $db";
  $result2 = mysql_query($query2);
  if ($result2)
     echo '<span class=p2><b>Profile Successful</b></span><br /><br />';
     echo '<span class=psparkblu12><b>';
     echo $myrow["login"];
     echo '</b> You have successful updated your user profile for your property posting account</span><br /><br />';
     echo '<a class=pmidblu href="proppost_controlpanel.php">Click here to return to Property Post Control Panel</br></a>';
http://www.realestatenetfind.com/edit_ownersignup.phps

http://www.realestatenetfind.com/edit_o ... nsert.phps


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Mar 10, 2005 10:49 pm
by feyd
I'd bet it's your $db variable in the query string.. if you change the query call to use mysql_error() on failure, you will find out.

mysql_error()

Posted: Fri Mar 11, 2005 12:01 am
by redzonne
Whoa!! your right!

I changed
$result2 = mysql_query($query2);
to
$result2 = mysql_query($query2) or die(mysql_error());

and I got the following error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' Resource id #11' at line 1

Not quite sure what it means though...

Posted: Fri Mar 11, 2005 12:03 am
by feyd
$db is supposed to be passed to mysql_query() via the second argument, not in the query string.