Hi, BluPrince
The start often seems troublesome, but take heart. Let's start from scratch.
In the vast majority of cases, you may ignore HTML tags in your Coldfusion
page. Coldfusion and the webserver will put them in in the background before
sending the response to the browser. So you may just save the following code
as [i]myDatabaseConnectionTest.cfm[/i] in the web root. That is, in the wwwroot
folder of your Coldfusion installation.
<!--- Query students table. Datasource configured in Administrator--->
<cfquery name="getStudents" datasource="studentDSN">
select * from students
</cfquery>
<!--- Dump query result--->
<cfdump var="#getStudents#">
To configure Coldfusion for MySQL, follow these steps.
1) Open the Coldfusion Administrator -- usually by pointing the browser to:
http://localhost:8501/CFIDE/administrator/
Then go to the datasources page.
2) Enter/Select the following values
Data Source Name: studentDSN
Driver: MySQL(4/5)
Click on the [i]Add[/i] button. You should get configuration page for your new
datasource.
3) Enter the following values
Database: students
Server: 127.0.0.1 Port: 3306
Username: root
Password: gateway
Leave the [i]Description[/i] field empty. I have made these assumptions:
- you have MySQL 4.x or MySQL 5.x;
- you have created a database called [i]students[/i] (which contains the table
called [i]students[/i])
- your MySQL username is [i]root[/i] and your password is [i]gateway[/i]
4) Press [i]Submit[/i] for Coldfusion to create the datasource. Your new
datasource should appear in the list [i]Connected Data Sources [/i]
5) Assuming everything has gone well so far, close the browser (to leave the
Coldfusion Administrator).
6) Open the page [i]myDatabaseConnectionTest.cfm[/i] -- usually by pointing
the browser to:
http://localhost:8500/myDatabaseConnectionTest.cfm