SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    looking at a quey from a seperate page

    Hi
    How do you get a query to look at a query on another page, without having to copy that query and paste it in the page your working on

    for example: ive the option of sending invoices manually and automatically and I have the image in the action page when I manually send them, without coping and pasting the code I need I want to ba able to reference abck to this, (it will same me having to update the same query twice if it needs to be changed down the line

  2. #2
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Aberdeen, Scotland
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to take this right back to basics put the query in a separate cfm file and call it into the page(s) your needing it in with <cfinclude />. Then just call it on your other page like it exists with everything else.

    That's a REALLY old way of doing things though (going back to version 5 of CF and below) and isn't very modular.

    If you want to go with "Best Practice" then the query should be placed in a CFC and that called into each of your pages when needed:

    http://www.adobe.com/devnet/coldfusi...ntro_cfcs.html

    The advantages of CFCs if you can modularise your code into "blocks" so it makes it easier to manage as your application grows.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks for that


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •