|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
This is probably a simple problem for most of you, but I'm pulling my hair out and it's an endangered species as it is.
I have a mysql one table database with 6 fields that I'm using with php. id_ohg - auto-increment, id field PCode - varchar Name - varchar Desc - TEXT CP - decimal SP - decimal My problem is updating the TEXT field (Desc). I get a mysqlerrno of 1064 (you have an error near...) with this sql statement: $query = "UPDATE ohg set PCode = '$pcode', Desc = '$pdesc', Name = '$pname', CP = '$CP', SP = '$SP' where id_ohg = '$id_ohg' LIMIT 1"; this sql statement works perfectly: $query = "UPDATE ohg set PCode = '$pcode', Name = '$pname', CP = '$CP', SP = '$SP' where id_ohg = '$id_ohg' LIMIT 1"; As you can see, the only difference is the Desc field and value. Any thoughts? many thanks. Jeff |
|
#2
|
||||
|
||||
|
Isn't DESC a reserved word?
It may not like you using that as a fieldname. |
|
#3
|
|||
|
|||
|
Aha! That's it. (he said red-faced)
Thanks for your help! |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > TEXT field update problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|