• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Step 3. Databases and SQL > Example 3.1: Creating an Employee List

Example 3.1: Creating an Employee List

In this example, we are going to create a page that lists all of our employees. We would like to see their first names, last names, and extension numbers. We would also like to list them alphabetically by their last names.

NOTE

You can place your <CFQUERY> code anywhere in your template as long as it is before any <CFOUTPUT> block that tries to use the results. Many programmers choose to place all query code at the top of the template before any HTML. This way, queries are easy to locate, and you can be certain they will run before any <CFOUTPUT> blocks that might try to display the results. Some programming methodologies such as Fusebox also promote keeping your queries in separate files and using <CFINCLUDE> to include them in other templates where necessary.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint