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

Chapter 7. Using Databases > Connecting to the Database

Connecting to the Database

<cfquery> is used to prepare and submit an SQL statement to a data source. <cfquery> and its attributes also can be used to override the default settings on the data source connection to the database. Any SQL statement that can be interpreted by the database and its driver can be sent, including SELECT, UPDATE, and INSERT statements:

<cfquery name="users"
         datasource="dsn">
SELECT LastName, FirstName, EmpID
FROM Users
</cfquery>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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