jaymc Posted August 10, 2007 Share Posted August 10, 2007 I have a `views` field in my database which stores how many page views Ive had Tp update it I pull out the current value with a SELECT, add++ one to it then UPDATE the new value back in Is there anyway to do this without first pulling out the initial value Perhaps a special field type ? Link to comment https://forums.phpfreaks.com/topic/64197-solved-update/ Share on other sites More sharing options...
cmgmyr Posted August 10, 2007 Share Posted August 10, 2007 try... UPDATE my_table SET my_column = my_column + 1 WHERE id = $id Link to comment https://forums.phpfreaks.com/topic/64197-solved-update/#findComment-320036 Share on other sites More sharing options...
jaymc Posted August 15, 2007 Author Share Posted August 15, 2007 Excellent Link to comment https://forums.phpfreaks.com/topic/64197-solved-update/#findComment-324309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.