Freakin' Out - Loop with Conditions

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Freakin' Out - Loop with Conditions

    I'm using Dreamweaver, PHP, MySQL to put together a site. Right, here's the
    problem.

    I've got a database full of entries (200) of which each entry fits into one
    of a selection of Categories (about 10). When I "Repeat" a Category (in a
    menu) they all get displayed - which is what I want, but I don't want any of
    the Category names to be repeated.

    For example:

    apple
    pear
    bannana

    and not:

    apple
    pear
    apple
    apple
    pear
    bananna
    apple
    pear

    Does anyone know what I'm talking about?

    Regards,

    Bruce


    Bruce Guest

  2. Similar Questions and Discussions

    1. HEEEEEEEEEEEELP NO FREAKIN SOUND IN MY FLASH AND IMDESPERATE TO HAVE IT BAAACK!!!
      PLEEEZ help me... my flash animation works but the sound dusnt i have a microphone installed on my computer and in the settings it will say...
    2. Film loop rollovers working with tell sprite, but only if Loop is checked
      on mouseWithin me cursor 280 tell sprite 40 --the sprite containing the film loop sprite(60).member = member("networkmapsbuttonroll") --swapping...
    3. Urgent: Repeat loop and Film loop clash!
      Hi All, Scenario I have a script running in which the spelling which was typed in by the student is corrected. The alphabets are moved to...
    4. Help with loop inside loop and mysql queries
      Hi List. I cannot see my error: I have relation tables setup. main id entity_name main_type etc etc date_in 1 test type1 x y 2003-06-02...
    5. Im Freakin out - pop-up menu error in DW4
      hi guys, Thanks for the replies, just been reloading and upgrading my p.c and software. I think i have craked it........ ...
  3. #2

    Default Re: Freakin' Out - Loop with Conditions

    Bruce wrote:
    > apple
    > pear
    > bannana
    >
    > and not:
    >
    > apple
    > pear
    > apple
    > apple
    > pear
    > bananna
    > apple
    > pear
    >
    > Does anyone know what I'm talking about?
    >
    SELECT DISTINCT fruit FROM stuff;

    or

    SELECT fruit, count(*) FROM stuff GROUP BY fruit

    HTH

    C.
    Colin McKinnon Guest

  4. #3

    Default Re: Freakin' Out - Loop with Conditions

    Another idea would be using array_unique in PHP.

    [url]http://www.php.net/array_unique[/url]

    On Fri, 09 Jul 2004 10:36:14 +0100, Colin McKinnon
    <colin.deletethis@andthis.mms3.com> wrote:
    >Bruce wrote:
    >
    >> apple
    >> pear
    >> bannana
    >>
    >> and not:
    >>
    >> apple
    >> pear
    >> apple
    >> apple
    >> pear
    >> bananna
    >> apple
    >> pear
    >>
    >> Does anyone know what I'm talking about?
    >>
    >
    >SELECT DISTINCT fruit FROM stuff;
    >
    >or
    >
    >SELECT fruit, count(*) FROM stuff GROUP BY fruit
    >
    >HTH
    >
    >C.
    eclipsboi 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