rofl90 Posted March 12, 2008 Share Posted March 12, 2008 Heres my 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 'SET name='Charlie Kirk', title='Senior Designer', about='Hi there, my name is Ch' at line 1 and the coding; $name = addslashes($_POST['name']); $title = addslashes($_POST['title']); $about = addslashes($_POST['about']); $phone = addslashes($_POST['phone']); $email = addslashes($_POST['email']); $skype = addslashes($_POST['skype']); $world = addslashes($_POST['world']); $house = addslashes($_POST['house']); $query = "UPDATE $myuser SET name='$name', title='$title', about='$about', phone='$phone', email='$email', skype='$skype', world='$world', house='$house'"; mysql_query($query) or die(mysql_error()); echo "Updated"; echo $myuser; echo "'s profile!"; Quote Link to comment Share on other sites More sharing options...
rofl90 Posted March 12, 2008 Author Share Posted March 12, 2008 bump Quote Link to comment Share on other sites More sharing options...
conker87 Posted March 12, 2008 Share Posted March 12, 2008 You need a WHERE clause, it doesn't know what rows to update. $query = "UPDATE $myuser SET name='$name', title='$title', about='$about', phone='$phone', email='$email', skype='$skype', world='$world', house='$house' WHERE `column` = 'blah'"; Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 12, 2008 Share Posted March 12, 2008 It is highly likely that $myuser is empty and the query is - UPDATE SET name='$name', ... Echo your $query variable to make sure it contains what you expect. Quote Link to comment Share on other sites More sharing options...
revraz Posted March 12, 2008 Share Posted March 12, 2008 Yep, two things wrong, the tablename and no WHERE function. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 12, 2008 Share Posted March 12, 2008 The no "where" wouldn't cause a MySQL syntax error, but the OP probably wouldn't get the results he was looking for. Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.