Forums

ASP

This topic is locked

how can i do this

Posted 19 Jun 2005 09:04:04
1
has voted
19 Jun 2005 09:04:04 Jaime Romo posted:
hello there i whant to do this:
im not very good in asp but im traying to do this
i have a gallery and i whant to display the top ten clickeds images
so i display the gallery and when a user clicks on any image it inserts on a new table the name of the image and a numer 1
soy when i whant to display the most clickes image how do i make a query that select the image and the one that has more records

when the image is clickes i have a insert so every time the image is clickes it adds a nw record
i was thinking about select count but i cant meke it work

help please???



Visit my home page
www.cancuncoral.com

Replies

Replied 20 Jun 2005 17:42:08
20 Jun 2005 17:42:08 Daniel Severns replied:
There is a better and more efficient way to record the number of clicks. You could imagine that if you insert a record every time a picture is clicked, the table could become huge!

Try this instead of inserting a record every time, use an update command:

UPDATE tblpics ‘the name of your table

SET CLICK_COUNT = CLICK_COUNT + 1
WHERE PIC_ID = " & Request("PIC_NAME_HERE"

Create a field where the recordset of the dynamic picture resides in the table and update that field +1 every time its clicked WHERE the clicked picture = the URL or were ever you get the picture name from. Make sense?

D

--------------------
MtnManDan

www.curiouscal.com

Reply to this topic