News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Basic DB question?

Started by PoLlama, August 16, 2007, 12:56:39 PM

Previous topic - Next topic

PoLlama

Just for clarification(this will help me a lot), could someone please give me the code for loading a integer from a database, adding one to it, and saving it back to the database.

Also, for row-types, I notice tinyint4 acts as a boolean, why is that? Shouldn't tinyint2 be a boolean?

PoLlama

Come on, there must be a lot of people who know how to do this, its really not a big deal.

I just want...

Get integer from (db)table row
Set integer + 1
Save integer to (db)table row

Whether or not a variable is needed I don't know..

spottedhog

Here is an example:

UPDATE (tablename) SET views=views+1;

Advertisement: