Cold Fusion

Cold Fusion Basics
Cold Fusion & Databases
Cold Fusion Resources
Enable Cold Fusion

 SITE SEARCH:

OWH,

By the way, I have to make a comment. We moved to OneWorldHosting back in May from another vendor. I have never been sorry for that decision. OWH has simply been the most reliable and responsive host I've ever seen. Response to my technical questions has always been exceptionally good. Thanks for the follow up.

Keith
 



 
 

Cold Fusion Databases:

 

Cold Fusion and database interaction very often go hand-in-hand. Cold Fusion can work with any ODBC compliant database as long as it has been converted into the MySQL environment. For step-by-step instructions in making the conversion please review: Using ODBC
Once you have a MySQL database set-up you need to make sure that you use a database connection string in the body of the cfm file. The example .cfm file from the previous page:

<cfquery datasource="database" password="db-password" username="db-username" name="products">

SELECT id, name, price
FROM products
ORDER BY id
</cfquery>

<html>
<head>
<title>Products List</title>
</head>
<body>
<table cellpadding=5>
<tr bgcolor="788C78">
<td>Item ID</td><td>Name</td><td>Price</td>
</tr>
<cfoutput query="products">
<TR bgcolor="CCCC99"><TD align="center">#id#</td><TD>#name#</td><TD>#price#</td></tr>
</cfoutput>
</table>
</body>
</html>

The first line shows the connection string and the variables needed to interact with the database successfully:

<cfquery datasource="database" password="db-password" username="db-username" name="products">

Where:
"datasource" is the name of the MySQL database
"password" is the password for the database
"username" is the username for the database
"name" is the name of the table from which data is being used/presented

This string and the SQL instructions/requests must be enclosed inside of the
<cfquery></cfquery>
tags as in the example above, shown again here:

<cfquery datasource="database" password="db-password" username="db-username" name="products">

SELECT id, name, price
FROM products
ORDER BY id
</cfquery>

For more information on Cold Fusion please review: Cold Fusion Resources

 

 

ORDER ONLINE | Hosting Plans | Resellers | E-Commerce
Technical Support | Why One World | Contact One World