RE: UPDATE multiple columns, returning an error?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi Ive been spending the last day trying to work out why im getting an
> error when trying to UPDATE columns in a table.
> 
> heres the update code im using.
> 
> $query="UPDATE software SET title='$ud_title', dec='$un_dec' WHERE
> id='$ud_id'";
> $dbResult = mysql_query($query, $dbLink)
> or die ("Database Error: " . mysql_error() );
> 
> if I only update title='$ud_title' it works fine but when I try to
update
> more than one column it returns this error.
> 
> Database 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 'dec='' WHERE id='1'' at line 1

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html
#Reserved_words

DEC is a reserved word. Choose another column name. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux