I have this sql="UPDATE users SET firstname=$firstname, lastname=$lastname, email=$email WHERE username='$username'" im using to update a user profile. Problem is that it only seems to take numbers as the update. If I try to type characters a-z or A-z it doesn't update?....what gives.
You can see live example here: www.magform.com (you will have to sign-up, then check profile)
You put quotes around the string in the WHERE clause, but why don't you put quotes around the strings in the SET clause?
I saw it in the MySQL manual (you should be over joyed of all people.) and so now that it doesn't work im comming here....
What exactly did you see, and in which manual?
(and yes, I am very happy that you read the manual)
In an SQL query, all strings must be quoted. How else is SQL going to know if you mean a string or a column name or an operator? 🙂
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#UPDATE
"SET age=age+1" ....so I just took it literally....oh well problem solved.
Hmm.. the manual should have given an example of updating strings too.. tsk tsk .. those MySQL boys.. will they ever learn? :-)