|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to do a "selective" table UPDATE?
Hi all,
not sure how to word this..but here goes: i have a table with a column of data type smallint. how could i increase that number that's stored in the smallint by 1...only when certain pages or conditions are meet, in other words...an autoincrement is not wanted here because i don't want to increase that # by one each and every time the table is updated (for other columns). is it possible to do an UPDATE (with a ++ on the column) on the table w/o first doing a SELECT to get the present number? thanks! |
|
#2
|
|||
|
|||
|
RE: How to do a
just tried an update.Use this syntax:
$query="UPDATE table SET field=field+1 WHERE otherfield = 'something'" It worked for me. |
|
#3
|
|||
|
|||
|
RE: How to do a
very kewl...thanks bob.
didn't realize it would be so simple |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > How to do a "selective" table UPDATE? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|