Chris Norloff asked:
> The question is whether to use Val() or IsNumeric to prevent
> non-numeric characters from being inserted/updated to the
> database. I know this is an individual choice based on your
> own need, but I'm curious what others use.
> Val() or IsNumeric?

Personally, I use IsNumeric() 100% and never use Val().  Primarily because
of the reason you listed:

> 2. IsNumeric is nicer in that if used correctly if completely
> protects the database.

My logic works on those same lines: Val() will turn something into a number,
but I don't want something *turned into* a number, I want it to *already be*
a number.  Sure, it takes longer to code initially, but it saves me massive
amounts of time later on debugging and handling lusers.

-R
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to