Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 5 of 5

Thread: sql questions, problem with select *

  1. #1
    lunatic's Avatar
    9,895
    posts
    "I feel like I'm taking crazy pills!"

    sql questions, problem with select *

    Hi all

    I am using coldfusion to pass a URL variable in a link:
    Code:
    <a href="docDetail.cfm?Job_Number=<cfoutput>#url.RecordID#</cfoutput>">View documents for this record</a>
    I know it is being passed correctly because it shows up in the address bar of the linked page called docDetail.

    On the docDetail page is my sql query:
    Code:
    <cfquery name="q_docDetails" datasource="PLOG">
    SELECT *
    FROM data_admin.PlogDocs
    WHERE Job_Number = '#URL.Job_Number#'
    ORDER BY DocName DESC 
    </cfquery>
    The problem is that it is only displaying one record - the last one - for any given job number. I may have several different documents that all have the same job number but only the last one is being displayed. I am simply using cfoutput to display them in a table.

    Any ideas?

    Thanks!
    "i walk in stride with people much taller than me and partly it's the boots but mostly it's my chi and i'm becoming transfixed with nature and my part in it which i believe just signifies i'm finally waking up "


  2. #2
    lunatic's Avatar
    9,895
    posts
    "I feel like I'm taking crazy pills!"
    Okay so now I'm thinking it's an html problem. I have another page that displays everything in the table. It works great. I copied the same exact code but changed the query to output the records from a different table. Once again only the last record shows! WHY?!

    I have this nifty sort function on each column. When I click on it it sorts the records based on that column. When I click it again it does a reverse sort. On this problem page of mine that only displays the last record - when I click on the column name it does the reverse sort and only displays the first record?

    Can anyone think of why table is only showing one record?

    Last edited by lunatic; March 2nd, 2005 at 08:35 PM.
    "i walk in stride with people much taller than me and partly it's the boots but mostly it's my chi and i'm becoming transfixed with nature and my part in it which i believe just signifies i'm finally waking up "


  3. #3
    lunatic's Avatar
    9,895
    posts
    "I feel like I'm taking crazy pills!"
    okay never mind, I'm an idiot

    I was doing <cfoutput> and need to do <cfoutput query="myquery">

    The sad thing is I think I've done this before!

    thanks anyway
    "i walk in stride with people much taller than me and partly it's the boots but mostly it's my chi and i'm becoming transfixed with nature and my part in it which i believe just signifies i'm finally waking up "


  4. #4
    awe shucks i was too late

  5. #5
    lunatic's Avatar
    9,895
    posts
    "I feel like I'm taking crazy pills!"
    lol, I bet you could have told me what my problem was too!
    "i walk in stride with people much taller than me and partly it's the boots but mostly it's my chi and i'm becoming transfixed with nature and my part in it which i believe just signifies i'm finally waking up "


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012