ID: 72
Viewed: 4018
Added: Feb 04, 2002
Version:
Snippet uploaded by: snippet
Written By: Dr. Web
Demo: Sorry, no demo
Thank you for your vote. Please wait...
It appears you already voted for this snippet
It appears your vote value was empty
lets say the database is made up of two columns.... name and age.
name: age:
joe 29
Megan 21
bill 77
then you set up a .cfm page that runs a query against the database, AND outputs the results:
name: age:
joe 29
Megan 21
bill 77
then you set up a .cfm page that runs a query against the database, AND outputs the results:
<!---Head--->
none
<!---Body--->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<!--- query --->
<cfquery name="myStuff" datasource="wdbase" use\r\name="your use\r\name" password="the password">
select * from wdbase.dbo.tablename
</cfquery>
<table width=50%>
<tr>
<td><b>Name:</b></td>
<td><b>Age:</b></td>
</tr>
<!--- output from query --->
<cfoutput>
<!--- loop through every record retu\r\ned in the query --->
<cfloop query="myStuff">
<tr>
<td>#myStuff.name#</td>
<td>#myStuff.age#</td>
</tr>
</cfloop>
<!--- after looping through all the results continue--->
</cfouput>
</table>
</body>
</html>
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.