Hi, i'm creating something similar to an advertising system. I would like to show, for example, 5 ads (5 record) from a given database table. So i execute something like
SELECT * FROM mytable
ORDER BY view_counter ASC
LIMIT 5
ok, it works. But, how can contextualy update the "view_counter" (that is a counter with the number of show) maybe with a single SQL ? And, if i don't ask too much, is it possible to save the "position" which my record are returned ? For example, my sql return
- record F (pos. 1)
- record X (pos. 2)
- record Z (pos. 3)
And save in a field "Avarage_Position" the .. avarage of position ?
Thanks in advance.
Regards