Re: SQL field problem
| From: | Chris Earle | Date: | Wed, 10 Jul 2002 17:58:58 +0000 |
| Subject: | Re: SQL field problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106903@lists.php.net to get a copy of this message | ||
Martin's post is what you want... knew there was a query (just couldn't
remember it).
"Chris Earle" <chris@earleweb.com> wrote in message
news:20020710175704.43780.qmail@pb1.pair.com...
> I'd make another array that I can refer to and check for a value from the
> original query (which with a huge array could become cumbersome, but it
> doesn't look like you have will have too many duplicate names). Every
time
> you come across a new value, add it to the 2nd array (if it's not new,
then
> don't add it), then put the pointer of the array back to the start.
Return
> whether it was added or not, if it was added, then return 1 (true -- you
can
> display that word), or else return 0 (false -- it was already in the list
> and thus has been displayed).
>
> Of course you might not want to do this if both arrays are going to become
> huge (if the first is going to be like 10000 long, but the 2nd is only 4
> long then it might still be slow). I believe there is a SQL Query that
can
> cancel out duplicates for you.
>
> "Ed Lazor" <ELazor@providence.org> wrote in message
> ïD?>“
> @–ƒ©Íȇ¼,news:C8891DEC2698D411A91B00508BF9898806E118E3@phsormsg04.phsor.org...
> > You can refer to fields by their number.
> >
> > $Row[3];
> >
> > -----Original Message-----
> > From: mail@struempf.com [mailto:mail@struempf.com]
> > Sent: Wednesday, July 10, 2002 10:40 AM
> > To: php-general@lists.php.net
> > Subject: [PHP] SQL field problem
> >
> >
> > Hello
> >
> > I have a problem with mysql.I create a table with a field "kat".In this
> > field are entries like this :
> >
> > Light
> > Dark
> > Dark
> > Light
> > Robot
> > Find
> > Dark
> > Light
> >
> > You see that all entries are not unique.So i want to list as output all
> > entries but only once.If the word "Dark" is in the table 6 times php
> should
> > output dark only 1 time.
> > How should i solve this problem ?
> >
> > Thanks!
> > chris
> >
> >
>
****************************************************************************
> > This message is intended for the sole use of the individual and entity
to
> > whom it is addressed, and may contain information that is privileged,
> > confidential and exempt from disclosure under applicable law. If you
are
> > not the intended addressee, nor authorized to receive for the intended
> > addressee, you are hereby notified that you may not use, copy, disclose
or
> > distribute to anyone the message or any information contained in the
> > message. If you have received this message in error, please immediately
> > advise the sender by reply email and delete the message. Thank you very
> > much.
>
>