Jump to content

Easy One - Supposedly? Increment Value?


Chud37

Recommended Posts

I am writing a poll script.  I have an integer field in my DB, and i want to just open the DB, increment a value, and then display the results.  Currently i've got three query's running; one to get the current data, one to UPDATE the current data, and one to display the changed data.

 

This seems really rubbish to me.  There must be a way to increment an INT field in a DB simply by using SQL.  Can anyone help? I just need to plus one.

 

I've looked around and i can't find anything on the subject, or maybe im just not searching the right thing.  Anyway, please help.

 

~Chud37

Link to comment
https://forums.phpfreaks.com/topic/215691-easy-one-supposedly-increment-value/
Share on other sites

oh my.

 

I searched around and did not find any answers on this, i cant believe it is as simple as that! but it works.  Thanks!

 

p.s - i suppose i can perform all the other operations and do some fun algebra in SQL queries? i.e. fld=((fld+1)*5)/4 ?

 

Not that i want to in this point in time, but that would be legal, would it?

 

:)

 

Sorry for asking silly questions, like i said i couldnt find any documentation on it.

 

Thanks,

 

~Chud37

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.