|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ok, I've been working on this for about 3 hours now and I'm fed up.
*breathes deeply* I have the following sql string (using ASP and mySQL): sql = "UPDATE Needs_post SET cat_id="&cat_id&", title='"&title&"', desc='"&desc&"', fulfilled='"&fulfilled&"', requester='"&requester&"', phone='"&phone&"', notes='"¬es&"' WHERE id = " & request("id") .... and it errors out with: ADODB.Recordset.1 error '80004005' SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]You have an error in your SQL syntax near 'desc='blahblahblah' at line 1 /stuff/admin_edit_post.asp, line 34 /html ... the desc field is a multi-line textbox with virtual wrapping turned on (it doesn't matter about the wrapping anyway, even if I change that, it still gets the same error). ... the field in the database is "text" type and no other attributes or extras... it's supposed to be very simple. Any ideas? |
|
#2
|
|||
|
|||
|
I think I got it, correct me if I'm wrong..
So, correct me if I'm wrong.. but is "desc" a reserved word in mySQL databases or ChiliSoft or something like that? I can't believe it, but when I changed the table to "descrip" instead, and all the variables and everything, it worked... so far..
am I wrong in that assumption? Wee-tarded. |
|
#3
|
|||
|
|||
|
dont worry, it once took me 2 days to realise that my description field called 'desc' was causing me heaps of errors! dont worry it happens to the best of us.
|
|
#4
|
|||
|
|||
|
Yeah, reserved by sql92 standard.
Some reserved words (from postgres docs) |
|
#5
|
|||
|
|||
|
Another one?
So, what about cat_id? or catid? where can I get a list of the reserved words.. I think I just think along the programmer's lines too much, and I'm brand new at the mySQL db end. I typically work with access and postgreSQL...
thanks. |
|
#6
|
|||
|
|||
|
Thanks for the list.. that helps.. looks like we posted at the same time.. heh..
anyway, i'm having another prob with an Illegal operation on this line (I'll put in a few of them with an -> next to the one that's giving me the prob.) rs.addnew rs("organiz_id") = organiz_id -> rs("cat_id") = request("catid") rs.update any ideas from just that? It's a select sql statement, then I'm running this. what's the deal? |
|
#7
|
|||
|
|||
|
That's why I always use some sort of prefix on both tables and columns.. for example for my category table I have cat as the prefix for columns.. Like catId or catName
__________________
Best Regards, Håvard Lindset |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > mySQL Text Field and Update |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|