May 6, 2001
Confused about the difference between the SQL WHERE and HAVING clauses? Here's one way to remember the difference. WHERE is used to filter rows, HAVING is used to filter groups (and is only used when GROUP BY is used). When grouping data, WHERE filters data before it is grouped, and HAVING filters...
May 5, 2001
The SQL DISTINCT keyword forces SELECT operations to be performed on unique rows (ignoring duplicate values). If you are counting rows (using the COUNT() aggregate function) then DISTINCT may only be used if a column name is specified. DISTINT may not be used with COUNT(*). (Applies to: ColdFusion...
May 4, 2001
The SQL COUNT() aggregate function should be used to count the number of rows that match a condition (something that should never be done directly in CFML itself). But when counting, does COUNT() include rows with NULL values or not? The answer is - it depends. If you specify COUNT(*) then all rows...
May 3, 2001
provides an excellent mechanism with which to set variables, perform conditional processing, and implement loops. But unlike straight CFML, you cannot simply display expressions by typing them out. Instead, you must use the WriteOutput() function which takes the expression as a parameter. (Applies...
May 2, 2001
Need secure one-way string encryption? Try the Hash() function which takes a string and returns a 32 byte hexadecimal string, converted using an algorithm called MD5. You'll not be able to decode the string, but you'll be able to compare it to other encoded copies (which makes it useful for safely...
May 1, 2001
Your Web Server may be secure today, but that does not mean it will be secure tomorrow. New holes and hacks are being discovered on a regular basis, and to maintain a secure ColdFusion site you need to ensure that all software (not just ColdFusion) is secure. This means that you must regularly...
April 30, 2001
ColdFusion SESSION variables are usually shared by all open browsers because cookies are shared across all open browsers (and SESSION uses two cookies to identity the client browser). To establish a separate SESSION for each browser you need to not set cookies (this is a option), and instead pass...
April 29, 2001
The ColdFusion Studio Browse mode is used to test pages right within your Studio Editor. But many developers are unaware that this internal browser can also test pages at different screen sizes (so as to simulate the user experience for as many users as possible). When in Browse mode, click the...
April 28, 2001
Want to generate Excel content using ColdFusion? Here's a really easy way to do it. Generate comma-delimited output (CSV format) with each cell as a field and each row on its own line. Then set the MIME type (using ) to "application/vnd.ms-excel". When the page is retrieved it will be displayed in...
April 27, 2001
CFML is case-insensitive - is the same as which is the same as , and FORM.var is the same as form.var which is the same as Form.VAR. But just because you can use any choice of case does not mean you should. Pick one, any one, and use it exclusively. Some developers like using upper-case for all...