/ Forside / Teknologi / Udvikling / PHP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
PHP
#NavnPoint
rfh 3959
natmaden 3372
poul_from 3310
funbreak 2700
stone47 2230
Jin2k 1960
Angband 1743
Bjerner 1249
refi 1185
10  Interkril.. 1146
SQL spørgsmål.
Fra : Ghashûl


Dato : 11-03-01 10:42

Hey!
I'm having problems getting this to work.

I need a unique artist field, and it's ID.

"select DISTINCT artist,id from Cover where artist like '$sort%' order
by artist" doesn't work. It just doesn't return anything to my PHP
site.

"select DISTINCT artist from Cover where artist like '$sort%' order by
artist" This works, but I need the ID field...

Anyone got a clue as to what's up?

--
Regards Sir Ghashûl, Knight of The alt.Roundtable <><
ICQ: 7two23six29
E-mail: stefan at bruhn dot to
URL: http://ghashul.dk

 
 
Thomas Jensen - pil.~ (11-03-2001)
Kommentar
Fra : Thomas Jensen - pil.~


Dato : 11-03-01 10:41

On Sun, 11 Mar 2001 10:42:24 +0100, Ghashûl <look@my-sig.ghashul.dk>
wrote:


>I need a unique artist field, and it's ID.
>
>"select DISTINCT artist,id from Cover where artist like '$sort%' order
>by artist" doesn't work. It just doesn't return anything to my PHP
>site.
>
>"select DISTINCT artist from Cover where artist like '$sort%' order by
>artist" This works, but I need the ID field...
>
>Anyone got a clue as to what's up?

supplér evt. gerne m. en "desc Cover"... dvs. hvad hedder felterne i
din tabel?

--
med venlig hilsen
Thomas Jensen
http://pil.dk/

Ghashûl (11-03-2001)
Kommentar
Fra : Ghashûl


Dato : 11-03-01 11:02

On Sun, 11 Mar 2001 09:41:24 GMT, tj@dev.null (Thomas Jensen - pil.dk)
wrote:

>On Sun, 11 Mar 2001 10:42:24 +0100, Ghashûl <look@my-sig.ghashul.dk>
>wrote:
>
>
>>I need a unique artist field, and it's ID.
>>
>>"select DISTINCT artist,id from Cover where artist like '$sort%' order
>>by artist" doesn't work. It just doesn't return anything to my PHP
>>site.
>>
>>"select DISTINCT artist from Cover where artist like '$sort%' order by
>>artist" This works, but I need the ID field...
>>
>>Anyone got a clue as to what's up?
>
>supplér evt. gerne m. en "desc Cover"... dvs. hvad hedder felterne i
>din tabel?

Cover indeholder:
id,album,cover,artist,buylink,rc,rcurl,style,website.

Men det er kun artist og id jeg skal bruge i det her tilfælde.

--
Regards Sir Ghashûl, Knight of The alt.Roundtable <><
ICQ: 7two23six29
E-mail: stefan at bruhn dot to
URL: http://ghashul.dk

Claus O (11-03-2001)
Kommentar
Fra : Claus O


Dato : 11-03-01 14:16

"Ghashûl" <look@my-sig.ghashul.dk> wrote

> I need a unique artist field, and it's ID.
>
> "select DISTINCT artist,id from Cover where artist like '$sort%' order
> by artist" doesn't work. It just doesn't return anything to my PHP
> site.

Muligvis SELECT DISTINCT (artist), id FROM cover
group by artist

Claus (amatør) - så ingen garantier!
ellers prøv database NG´en.





N/A (11-03-2001)
Kommentar
Fra : N/A


Dato : 11-03-01 14:20



Ghashûl (11-03-2001)
Kommentar
Fra : Ghashûl


Dato : 11-03-01 14:20

On Sun, 11 Mar 2001 13:53:35 +0100, "Claus O"
<ClausOlsen@NOSPAMhotmail.com> wrote:

>
>"Ghashûl" <look@my-sig.ghashul.dk> wrote
>
>> I need a unique artist field, and it's ID.
>>
>> "select DISTINCT artist,id from Cover where artist like '$sort%' order
>> by artist" doesn't work. It just doesn't return anything to my PHP
>> site.
>
>Muligvis SELECT DISTINCT (artist), id FROM cover
>group by cover
>Claus (amatør) - så ingen garantier!
>ellers prøv database NG´en.
>

Det virkede desværre ikke.
Ellers tak for hjælpen.

Nu ligger spørgsmålet også i dk.edb.databaser og alt.php.sql

--
Regards Sir Ghashûl, Knight of The alt.Roundtable <><
ICQ: 7two23six29
E-mail: stefan at bruhn dot to
URL: http://ghashul.dk

Claus O (11-03-2001)
Kommentar
Fra : Claus O


Dato : 11-03-01 14:24


"Ghashûl" <look@my-sig.ghashul.dk> wrote

> >Muligvis SELECT DISTINCT (artist), id FROM cover
> >group by cover
> >Claus (amatør) - så ingen garantier!
> >ellers prøv database NG´en.
> >

Sikkert min fejl, som jeg rettede i senere indlæg:
group by artist
Claus



Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408877
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste