Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default query trouble

    i'm just getting started here, and am having trouble building queries. after
    filling in the information tables, i press the 'ok' button, and this pops up a
    wndow that says "Type error: this.node has no properties"
    i'm wondering what this means and how i can fix this. i've had the same
    trouble while doing the tutorials as well, and had to resort to copy/pasting my
    way through...
    have i missed filling in something, or would it be related to my database?

    heath_edw Guest

  2. Similar Questions and Discussions

    1. Trouble with sql query
      Hi, I'm sending the follwoing query to mysql from a php script: ...
    2. query of a query trouble
      Every time I try and use a col other then the default I get this error spit back at me ?Query Of Queries runtime error. Table named "getIDs" was...
    3. Trouble with url variable in query
      Hi there, I'm having trouble getting a database query that uses url variables to work. The query is <cfquery Name="Display"...
    4. Trouble with database query
      Hi, THIS (Below) error keeps coming. I'm just trying to make a normal login page. It LOOKS fine to me, I've groomed it for bad spaces and...
    5. Trouble getting data to my DB from the cfinput tag query
      if you simply view the screen shots linked here, http://www.e-nationmusic.com/code_views/insert_data.htm which are at the bottom of the entire code...
  3. #2

    Default query trouble

    Hell All,

    Never done this before. I want to query a table that looks like the
    following:\
    tournamentID| Playerid|points

    2 1 0
    2 2 6
    2 3 0
    2 4 2
    2 5 3
    2 6 4
    2 7 1
    2 8 10
    3 1 0
    3 2 6
    3 3 0
    3 4 8
    3 5 7
    3 6 1
    3 7 0
    3 8 0

    I want to create a query that returns each player id with the total of points
    for each playerid. I that possible with sql?

    for example playerid 2 should have a total of 12.

    Thanks



    LukeDD Guest

  4. #3

    Default Re: query trouble

    select playerid,count(*)
    from YourTable
    group by playerid
    SQLMenace Guest

  5. #4

    Default Re: query trouble

    select sum(points) as playerpoints, playerid
    from YourTable
    GROUP BY playerid, points
    philh Guest

  6. #5

    Default Query Trouble

    I have this query;
    SELECT *
    FROM shows, cast, characters, producers, producers_shows
    WHERE shows.id = characters.showid
    AND cast.id = characters.castid
    AND producers_shows.producer = producers.id
    LIMIT 0 , 30

    It works, except each show is repeated 3 times. Here is an XML dump
    from PHPMYADMIN:

    <!--
    - Database: 'sscake'
    -->
    <sscake>
    <!-- Table shows -->
    <shows>
    <id>1</id>
    <title>Home Improvement</title>
    <safe_title>Home+Improvement</safe_title>
    <start_year>1991</start_year>
    <end_year>1999</end_year>
    <type>Multi</type>
    <genre>Family</genre>
    <id>1</id>
    <name>Tim Allen</name>
    <safe_name>Tim+Allen</safe_name>
    <id>1</id>
    <showid>1</showid>
    <castid>1</castid>
    <name>Tim Taylor</name>
    <safename>Tim+Taylor</safename>
    <id>1</id>
    <name>Carmen Finestra</name>
    <safe_name>Carmen+Finestra</safe_name>
    <id>1</id>
    <show>1</show>
    <producer>1</producer>
    <role>Creator</role>
    </shows>
    <shows>
    <id>2</id>
    <title>Roseanne</title>
    <safe_title>Roseanne</safe_title>
    <start_year>1988</start_year>
    <end_year>1997</end_year>
    <type>Multi</type>
    <genre>Family</genre>
    <id>2</id>
    <name>Roseanne</name>
    <safe_name>Roseanne</safe_name>
    <id>2</id>
    <showid>2</showid>
    <castid>2</castid>
    <name>Roseanne Connor</name>
    <safename>Roseanne+Connor</safename>
    <id>1</id>
    <name>Carmen Finestra</name>
    <safe_name>Carmen+Finestra</safe_name>
    <id>1</id>
    <show>1</show>
    <producer>1</producer>
    <role>Creator</role>
    </shows>
    <shows>
    <id>1</id>
    <title>Home Improvement</title>
    <safe_title>Home+Improvement</safe_title>
    <start_year>1991</start_year>
    <end_year>1999</end_year>
    <type>Multi</type>
    <genre>Family</genre>
    <id>1</id>
    <name>Tim Allen</name>
    <safe_name>Tim+Allen</safe_name>
    <id>1</id>
    <showid>1</showid>
    <castid>1</castid>
    <name>Tim Taylor</name>
    <safename>Tim+Taylor</safename>
    <id>2</id>
    <name>Matt Williams</name>
    <safe_name>Matt+Williams</safe_name>
    <id>2</id>
    <show>1</show>
    <producer>2</producer>
    <role>Creator</role>
    </shows>
    <shows>
    <id>2</id>
    <title>Roseanne</title>
    <safe_title>Roseanne</safe_title>
    <start_year>1988</start_year>
    <end_year>1997</end_year>
    <type>Multi</type>
    <genre>Family</genre>
    <id>2</id>
    <name>Roseanne</name>
    <safe_name>Roseanne</safe_name>
    <id>2</id>
    <showid>2</showid>
    <castid>2</castid>
    <name>Roseanne Connor</name>
    <safename>Roseanne+Connor</safename>
    <id>2</id>
    <name>Matt Williams</name>
    <safe_name>Matt+Williams</safe_name>
    <id>2</id>
    <show>1</show>
    <producer>2</producer>
    <role>Creator</role>
    </shows>
    <shows>
    <id>1</id>
    <title>Home Improvement</title>
    <safe_title>Home+Improvement</safe_title>
    <start_year>1991</start_year>
    <end_year>1999</end_year>
    <type>Multi</type>
    <genre>Family</genre>
    <id>1</id>
    <name>Tim Allen</name>
    <safe_name>Tim+Allen</safe_name>
    <id>1</id>
    <showid>1</showid>
    <castid>1</castid>
    <name>Tim Taylor</name>
    <safename>Tim+Taylor</safename>
    <id>2</id>
    <name>Matt Williams</name>
    <safe_name>Matt+Williams</safe_name>
    <id>3</id>
    <show>2</show>
    <producer>2</producer>
    <role>Creator</role>
    </shows>
    <shows>
    <id>2</id>
    <title>Roseanne</title>
    <safe_title>Roseanne</safe_title>
    <start_year>1988</start_year>
    <end_year>1997</end_year>
    <type>Multi</type>
    <genre>Family</genre>
    <id>2</id>
    <name>Roseanne</name>
    <safe_name>Roseanne</safe_name>
    <id>2</id>
    <showid>2</showid>
    <castid>2</castid>
    <name>Roseanne Connor</name>
    <safename>Roseanne+Connor</safename>
    <id>2</id>
    <name>Matt Williams</name>
    <safe_name>Matt+Williams</safe_name>
    <id>3</id>
    <show>2</show>
    <producer>2</producer>
    <role>Creator</role>
    </shows>
    </sscake>

    thesimplerules@gmail.com Guest

  7. #6

    Default Re: Query Trouble

    [email]thesimplerules@gmail.com[/email] wrote:
    > I have this query;
    > SELECT *
    > FROM shows, cast, characters, producers, producers_shows
    > WHERE shows.id = characters.showid
    > AND cast.id = characters.castid
    > AND producers_shows.producer = producers.id
    > LIMIT 0 , 30
    >
    > It works, except each show is repeated 3 times. Here is an XML dump
    > from PHPMYADMIN:
    >
    <xml snipped>

    Well, for one thing you have the following joins:

    shows -> characters
    characters -> cast

    And

    producers_shows -> producers

    but there's no join between the

    shows->characters->cast and producers->shows


    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklex@attglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  8. #7

    Default Re: Query Trouble

    Thanks.

    I got it to work now, but is there a way to stop the whole row from
    repeating.
    Say when I have multiple rows in cast, producers of characters:

    Right now, I get two rows of show Home Improvement because I added two
    producers.



    Jerry Stuckle wrote:
    > [email]thesimplerules@gmail.com[/email] wrote:
    > > I have this query;
    > > SELECT *
    > > FROM shows, cast, characters, producers, producers_shows
    > > WHERE shows.id = characters.showid
    > > AND cast.id = characters.castid
    > > AND producers_shows.producer = producers.id
    > > LIMIT 0 , 30
    > >
    > > It works, except each show is repeated 3 times. Here is an XML dump
    > > from PHPMYADMIN:
    > >
    >
    > <xml snipped>
    >
    > Well, for one thing you have the following joins:
    >
    > shows -> characters
    > characters -> cast
    >
    > And
    >
    > producers_shows -> producers
    >
    > but there's no join between the
    >
    > shows->characters->cast and producers->shows
    >
    >
    > --
    > ==================
    > Remove the "x" from my email address
    > Jerry Stuckle
    > JDS Computer Training Corp.
    > [email]jstucklex@attglobal.net[/email]
    > ==================
    thesimplerules@gmail.com Guest

  9. #8

    Default Re: Query Trouble

    [email]thesimplerules@gmail.com[/email] wrote:
    > Jerry Stuckle wrote:
    >
    >>thesimplerules@gmail.com wrote:
    >>
    >>>I have this query;
    >>>SELECT *
    >>>FROM shows, cast, characters, producers, producers_shows
    >>>WHERE shows.id = characters.showid
    >>>AND cast.id = characters.castid
    >>>AND producers_shows.producer = producers.id
    >>>LIMIT 0 , 30
    >>>
    >>>It works, except each show is repeated 3 times. Here is an XML dump
    >>>from PHPMYADMIN:
    >>>
    >>
    >><xml snipped>
    >>
    >>Well, for one thing you have the following joins:
    >>
    >> shows -> characters
    >> characters -> cast
    >>
    >> And
    >>
    >> producers_shows -> producers
    >>
    >>but there's no join between the
    >>
    >> shows->characters->cast and producers->shows
    >>
    >>
    >>--
    >>==================
    >>Remove the "x" from my email address
    >>Jerry Stuckle
    >>JDS Computer Training Corp.
    >>jstucklex@attglobal.net
    >>==================
    >
    >
    > Thanks.
    >
    > I got it to work now, but is there a way to stop the whole row from
    > repeating.
    > Say when I have multiple rows in cast, producers of characters:
    >
    > Right now, I get two rows of show Home Improvement because I added two
    > producers.
    >
    >
    >
    (top posting fixed)

    Well, if you have two different producers, then you have two different
    combinations of shows and producers, right? So two rows would be
    appropriate.

    If you only want one copy of the show, don't include producers in your
    search.

    P.S. Please don't top post.



    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklex@attglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  10. #9

    Default Re: Query Trouble

    OK.

    What does top post mean?
    Jerry Stuckle wrote:
    > [email]thesimplerules@gmail.com[/email] wrote:
    > > Jerry Stuckle wrote:
    > >
    > >>thesimplerules@gmail.com wrote:
    > >>
    > >>>I have this query;
    > >>>SELECT *
    > >>>FROM shows, cast, characters, producers, producers_shows
    > >>>WHERE shows.id = characters.showid
    > >>>AND cast.id = characters.castid
    > >>>AND producers_shows.producer = producers.id
    > >>>LIMIT 0 , 30
    > >>>
    > >>>It works, except each show is repeated 3 times. Here is an XML dump
    > >>>from PHPMYADMIN:
    > >>>
    > >>
    > >><xml snipped>
    > >>
    > >>Well, for one thing you have the following joins:
    > >>
    > >> shows -> characters
    > >> characters -> cast
    > >>
    > >> And
    > >>
    > >> producers_shows -> producers
    > >>
    > >>but there's no join between the
    > >>
    > >> shows->characters->cast and producers->shows
    > >>
    > >>
    > >>--
    > >>==================
    > >>Remove the "x" from my email address
    > >>Jerry Stuckle
    > >>JDS Computer Training Corp.
    > >>jstucklex@attglobal.net
    > >>==================
    > >
    > >
    > > Thanks.
    > >
    > > I got it to work now, but is there a way to stop the whole row from
    > > repeating.
    > > Say when I have multiple rows in cast, producers of characters:
    > >
    > > Right now, I get two rows of show Home Improvement because I added two
    > > producers.
    > >
    > >
    > >
    >
    > (top posting fixed)
    >
    > Well, if you have two different producers, then you have two different
    > combinations of shows and producers, right? So two rows would be
    > appropriate.
    >
    > If you only want one copy of the show, don't include producers in your
    > search.
    >
    > P.S. Please don't top post.
    >
    >
    >
    > --
    > ==================
    > Remove the "x" from my email address
    > Jerry Stuckle
    > JDS Computer Training Corp.
    > [email]jstucklex@attglobal.net[/email]
    > ==================
    thesimplerules@gmail.com Guest

  11. #10

    Default Re: Query Trouble

    [email]thesimplerules@gmail.com[/email] wrote:
    > Jerry Stuckle wrote:
    >
    >>thesimplerules@gmail.com wrote:
    >>
    >>>Jerry Stuckle wrote:
    >>>
    >>>
    >>>>thesimplerules@gmail.com wrote:
    >>>>
    >>>>
    >>>>>I have this query;
    >>>>>SELECT *
    >>>>
    >>>>>FROM shows, cast, characters, producers, producers_shows
    >>>>
    >>>>>WHERE shows.id = characters.showid
    >>>>>AND cast.id = characters.castid
    >>>>>AND producers_shows.producer = producers.id
    >>>>>LIMIT 0 , 30
    >>>>>
    >>>>>It works, except each show is repeated 3 times. Here is an XML dump
    >>>>
    >>>>>from PHPMYADMIN:
    >>>>
    >>>><xml snipped>
    >>>>
    >>>>Well, for one thing you have the following joins:
    >>>>
    >>>> shows -> characters
    >>>> characters -> cast
    >>>>
    >>>> And
    >>>>
    >>>> producers_shows -> producers
    >>>>
    >>>>but there's no join between the
    >>>>
    >>>> shows->characters->cast and producers->shows
    >>>>
    >>>>
    >>>>--
    >>>>==================
    >>>>Remove the "x" from my email address
    >>>>Jerry Stuckle
    >>>>JDS Computer Training Corp.
    >>>>jstucklex@attglobal.net
    >>>>==================
    >>>
    >>>
    >> > Thanks.
    >> >
    >> > I got it to work now, but is there a way to stop the whole row from
    >> > repeating.
    >> > Say when I have multiple rows in cast, producers of characters:
    >> >
    >> > Right now, I get two rows of show Home Improvement because I added two
    >> > producers.
    >> >
    >> >
    >> >
    >>
    >>(top posting fixed)
    >>
    >>Well, if you have two different producers, then you have two different
    >>combinations of shows and producers, right? So two rows would be
    >>appropriate.
    >>
    >>If you only want one copy of the show, don't include producers in your
    >>search.
    >>
    >>P.S. Please don't top post.
    >>
    >>
    >>
    >>--
    >>==================
    >>Remove the "x" from my email address
    >>Jerry Stuckle
    >>JDS Computer Training Corp.
    >>jstucklex@attglobal.net
    >>==================
    >
    >
    > OK.
    >
    > What does top post mean?
    > Jerry Stuckle wrote:
    >
    (Top post fixed again)

    Top posting is posting your answer before the quote you're responding to
    (like you did).

    This group uses bottom posting (like this) or interwoven posting, where
    your response is mixed in with the rest of the post (generally used when
    responding to longer posts).

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklex@attglobal.net[/email]
    ==================
    Jerry Stuckle Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139