[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

seperating sql queries from HTML content

Hi,

I am trying to improve my code and would like to know what are is the best practice of seperating SQL queries from the page layout (html)

I am a novice to coldfusion so would be greatful for a brief explanation and links to good tutorials!

thanks in advance
0
joehodge
Asked:
joehodge
1 Solution
 
adonis1976Commented:
you can use CFCs to cover the business logic.. and stored procedured whereever possible for querying the dbs.. and your cfm pages will just hav calls to CFCs, stored procedures and the html ...
0
 
pinaldaveCommented:
Hi,
CFC are the way to go :
Intorduction and tutorial: http://www.sitepoint.com/article/components-introduction
CFC development center and tutorials: http://www.macromedia.com/devnet/mx/coldfusion/cfcs.html
Regards,
---Pinal
0
 
mrichmonCommented:
Another option that isn't so drastic for small sites is that all your queries should be at the top of the page - above even the DOCTYPE for the page.

That way all of the cold fusion /SQL code needed to get the data and logic involved is at the top of the page and only the necessary parts for display are embedded in the HTML
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now