Re: query error...
| From: | Miles Thompson | Date: | Wed, 06 Feb 2002 00:11:26 +0000 |
| Subject: | Re: query error... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16545@lists.php.net to get a copy of this message | ||
Did you type this out or cut/paste? There was a comma missing between >>> state"\"zip <<<. Should work when you add the comma.
Add a WHERE condition for the update, otherwise every row will be set to these values.
Common practice is to use single quotes around the char variables, saves a lot of escaping, keeps things more readable. In connection with this, echoing $sql would probably have revealed the missing comma, and don't feel badly, we've all done it.
Hope this sees you right - Miles
At 02:43 AM 1/31/2002 -0700, jas wrote:
Ok what is wrong with this sql statement? $sql = "UPDATE $table_name SET c_name=\"$c_name\",s_addy=\"$s_addy\",city=\"$city\",state=\"state\"zip=\"zi p\",phone="\$phone\""; The error I recieve is as follows Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /path/to/wwwdemo_change.php3 on line 22 Parse error: parse error in /path/to/wwwdemo_change.php3 on line 22 I have looked on MySQL.com at the update function and it states I can use the SET under UPDATE for multiple fields separated by a , and it is not working... Any insight would be great. Thanks in advance, Jas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php