I've been trying for some time now to get ColdFusion to make a unique userID
everytime a user is added to the database.
First I tried getting the maximum number of users in the users table by using
the RecordCount function, and then setting the new userID to increment by one
after that. But then I ran into a problem when I deleted a user as it created
duplicate values the next time someone was added.
Then I tried using the MAX function and I came up with this:
<cfquery name="Users" datasource="#datasource#">
SELECT MAX(userID) AS LastUser