Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 23rd, 2004, 03:57 PM
Registered User
 
Join Date: Jan 2004
Location: White Oak, Pa, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tkdk88 Send a message via MSN to tkdk88 Send a message via Yahoo to tkdk88
Default Trying to establish an ID variable


Hello,
     I'm trying to write the code for a website that I want to upload to a paid server for my new talent agency. I need to have a variable running on the server that sets my Talent ID# and keeps counting it just like autonumber in Microsoft Access. Do I have to cfset the variable or how can I do this so the variable doesn't reset to 0 everytime the page expires?

Respectfully submitted,
Larry V. Reitz, Jr.
  #2 (permalink)  
Old January 23rd, 2004, 05:24 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to take a look at the following two articles. They describe a Hit Counter scenario, implemented in ASP. There are no Cold Fusion versions of these articles available, but these articles may give you enough ideas to implement a similar solution in CF.

http://Imar.Spaanjaars.Com/QuickDocID.aspx?QUICKDOC=227
http://Imar.Spaanjaars.Com/QuickDocID.aspx?QUICKDOC=238

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old January 24th, 2004, 12:59 PM
Registered User
 
Join Date: Jan 2004
Location: White Oak, Pa, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tkdk88 Send a message via MSN to tkdk88 Send a message via Yahoo to tkdk88
Default

*** The problem is that I am a student and I have only had one class in Cold Fusion. I am taking 8 week classes which is not enough time to fully learn all this code. ***
Quote:
quote:Originally posted by Imar
 Hi there,

You may want to take a look at the following two articles. They describe a Hit Counter scenario, implemented in ASP. There are no Cold Fusion versions of these articles available, but these articles may give you enough ideas to implement a similar solution in CF.

http://Imar.Spaanjaars.Com/QuickDocID.aspx?QUICKDOC=227
http://Imar.Spaanjaars.Com/QuickDocID.aspx?QUICKDOC=238

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Respectfully submitted,
Larry V. Reitz, Jr.
  #4 (permalink)  
Old January 25th, 2004, 07:31 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, I never said you should learn all that code; I said the articles could give you some ideas how to implement this in Cold Fusion.

Basically, the idea *is* the same: store a global number somewhere in memory and in a text file or database. Each time the number gets increased, you should also update the number in the file or database.

Alternatively (and more safe in your situation), have the database hand out an AutoNumber. For each new ID you need, insert a record in a specific table. Let the database assign a new ID for the record and use that ID as your ID. If you search Google, you'll find numerous examples of Cold Fusion code that uses a database.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


Similar Threads
Thread Thread Starter Forum Replies Last Post
LoadFromSqlServer - Can't establish connection mungdrool BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 March 8th, 2006 04:08 PM
Establish Com link to Webpage Mantis Pro VB 6 3 April 18th, 2005 04:14 AM
How to establish a sql server desktop engine pramos.21d SQL Server 2000 0 March 2nd, 2005 09:50 AM
Passing a variable into the id() function EstherMStrom XSLT 5 January 19th, 2005 02:32 PM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.