mysql - Updating a Database With PHP -
I am trying to update my database records with the following code, but there is no luck yet. Any help to care? Thanks
& lt? Include php "base.php"; ? & Gt; & Lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD XHTML 1.0 Stronger // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Title & gt; Project Spoke & lt; / Title & gt; & Lt; Link rel = "stylesheet" href = "style.css" type = "text / css" /> & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php if (empty ($ _ session ['login in']) & amp; blank ($ _ session ['username']) {if (! (Empty ($ _ POST ['username']) & amp; ;;; ($ _ POST ['email'])) {$ newusername = mysql_real_escape_string ($ _ POST ['username']); $ Newemail = mysql_real_escape_string ($ _ POST ['email']); $ Edit = Mysql_query ("user update (user name, email address) value ('. $ Newusername' ''. $ Newemail. '') Where user id =". $ _ Session ['userID']. ""); // }? & Gt; & lt; div id = "container" & gt; div id = "homemenu">
You are using INSERT syntax for an UPDATE query. The syntax should be:
Set the YouTube username username = 'username', email address = 'email' where user id = 1;
.
Comments
Post a Comment