Forums

This topic is locked

50,000 people have read this...

Posted 06 May 2002 22:55:00
1
has voted
06 May 2002 22:55:00 David Thomas posted:
hi all,

on a DB for tutorials, how do i make a recordset count for each time a user reads a tutorial like seen here on Ud Zone.

[b[<u>Title | viewed 1300 times or whatever.</u>[/b]

Can i make the record insert a new count? or will i need one of these tracking scripts that are floating around?

Problem is, on a tracking script ive got, it wants all individual links to be tracked entered one by one, but all my links are dragged from a DB .... <img src=../images/dmxzone/forum/icon_smile_blackeye.gif border=0 align=middle>

Another problem, another day..

"Nobody ever said this stuff was easy"

Replies

Replied 06 May 2002 23:08:52
06 May 2002 23:08:52 Viktor Farcic replied:
Create numeric field in DB and update it every time the page loads. Something like: counter = counter + 1. To update recordset use Command/Stored Procedure from Server Behaviors.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
hi all,

on a DB for tutorials, how do i make a recordset count for each time a user reads a tutorial like seen here on Ud Zone.

[b[<u>Title | viewed 1300 times or whatever.</u>[/b]

Can i make the record insert a new count? or will i need one of these tracking scripts that are floating around?

Problem is, on a tracking script ive got, it wants all individual links to be tracked entered one by one, but all my links are dragged from a DB .... <img src=../images/dmxzone/forum/icon_smile_blackeye.gif border=0 align=middle>

Another problem, another day..

"Nobody ever said this stuff was easy"
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager
Replied 07 May 2002 01:59:21
07 May 2002 01:59:21 David Thomas replied:
Thanks for the reply Viktor, but a little bit more of a description on what to do would help.

So i have a field in DB called "counter".
Where does the "counter = counter + 1" come into play?
Is this the stored procedure?

Forgive the basic questions, but i've not used a stored procedure before.

Thanks again for your advice.

"Nobody ever said this stuff was easy"
Replied 07 May 2002 09:21:40
07 May 2002 09:21:40 Viktor Farcic replied:
Yes. Go to Bindings &gt; Command (Stored Procedure). Type in some name, select connection and choose update for type. After this choose table, set counter = counter + 1 and filter records (WHERE) using some unique identifier.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Thanks for the reply Viktor, but a little bit more of a description on what to do would help.

So i have a field in DB called "counter".
Where does the "counter = counter + 1" come into play?
Is this the stored procedure?

Forgive the basic questions, but i've not used a stored procedure before.

Thanks again for your advice.

"Nobody ever said this stuff was easy"
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager
Replied 07 May 2002 11:06:24
07 May 2002 11:06:24 Andrew Watson replied:
You could also just use these lines...

rsMyrecordset("ReadCount" = rsMyrecordset.Fields.Item("ReadCOunt".Value + 1
rsMyrecordset.Update

Pop them right below the recodset code.

Cheers

:: Son, im Thirty.... ::
Replied 20 May 2002 19:31:34
20 May 2002 19:31:34 David Thomas replied:
sorry about the late reply to this chaps, but i've just come back from holiday.

anyways, i couldn't get the counter to update.

I tried Victor's first and was a bit bogged down with the SQL (Total amatuer i know), so I tried Leed's code and popped them in right below the Recordset code and guess what...

error error error...

So if i put the code up here, could one of you fine chaps comment it for me on where to put the code properly..

cheers for this
Dave

p.s. this is for a repeated region and NOT a single field on a detail page.

"Nobody ever said this stuff was easy"

Edited by - DavieT on 21 May 2002 20:26:40
Replied 21 May 2002 17:22:51
21 May 2002 17:22:51 Dave Clarke replied:
Hi any chance of a javascript version?

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
You could also just use these lines...

rsMyrecordset("ReadCount" = rsMyrecordset.Fields.Item("ReadCOunt".Value + 1
rsMyrecordset.Update

Pop them right below the recodset code.

Cheers

:: Son, im Thirty.... ::
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 21 May 2002 20:46:56
21 May 2002 20:46:56 LiToZ LiToZ replied:
Well, in the command &gt; stored procdures choose the [ update ] function and make a code like:

UPDATE HitCounts
SET HitCounts.CurrentHits = HitCounts!CurrentHits+1
WHERE PageName = 'CurentPage'

.................
Hitcounts: the Table name
CurrentHits: the Feild name
PageName: The feild which stores the page name where the recordset will be updated with respect to.
CurrentPage: A variable that holdes the current page name
Replied 21 May 2002 23:53:01
21 May 2002 23:53:01 David Thomas replied:
thanks for that, i like the way you explained it, made it a bit easier for me to understand, will give it a go...

"Nobody ever said this stuff was easy"

Reply to this topic