Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Increase The Value of A Field

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a data field 'thread_reply_count'. I want to increase the value of this data field by 1. Is this the correct code?
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no, assuming that the value is a number in the database, you'd have to lose the single quotes:
ing sql = "UPDATE message_thread SET thread_reply_count = thread_reply_count + 1 WHERE thread_id = " + threadID;
I also got rid of the double semi colon.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic