MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 17th, 2005, 11:25 PM
JeffRad JeffRad is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 JeffRad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question TEXT field update problem

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

Reply With Quote
  #2  
Old January 18th, 2005, 09:04 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Isn't DESC a reserved word?
It may not like you using that as a fieldname.

Reply With Quote
  #3  
Old January 18th, 2005, 09:30 AM
JeffRad JeffRad is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 JeffRad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Aha! That's it. (he said red-faced)
Thanks for your help!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > TEXT field update problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT