Roboc Posted January 13, 2006 Report Share Posted January 13, 2006 Gribeeju luugt jums nelielu paliidziibu. Probleema tada, ir datubaaze, kuraa ir detalju saraksts, veelos izvadiit vinjas peec nosaukumiem, taa lai vienaadaas neatkaartojas (piemeeram saraksts ir a,a,b,c,d,a,c,d, un rezultaataa veelos ieguut a,b,c,d,) pamekleejot pa sho forumu atradu vairaakus variantus, no kuriem vispiemeerotaakais likaas ar GROUP BY, bet veicot pieprasiijumu vinjsh rezultaataa neko neizvada.. taatad mans pieprasiijums: $q = @mysql_query("SELECT detala FROM $table GROUP BY detala"); while ($row=@mysql_fetch_array($q)) { print("$row[detala]<br>"); } Varbuut zinaat, kas pa vainu, vai arii kaadu veidu, kaa to panaak savaadaak?! Link to comment Share on other sites More sharing options...
bubu Posted January 13, 2006 Report Share Posted January 13, 2006 (edited) Vispirms palaid šo, un tikai tad runāsim tālāk: $q = @mysql_query("SELECT detala FROM $table GROUP BY detala"); if ($q===FALSE) { echo "MySQL pieprasījuma kļūda: ", mysql_error(); die(); } while ($row=@mysql_fetch_array($q)) { print("$row[detala]<br>"); } un vispār - paskaties dokumentācijā par DISTINCT() fju, GROUP BY te nav galīgi nu jālieto. Edited January 13, 2006 by bubu Link to comment Share on other sites More sharing options...
Analgiins Posted January 13, 2006 Report Share Posted January 13, 2006 un kādu erroru MySQL's met ārā? Link to comment Share on other sites More sharing options...
Roboc Posted January 14, 2006 Author Report Share Posted January 14, 2006 Liels jums paldies!! :) Nosaakuma bij probleema ar sintaksi, novaacu nost ORDER BY, un tad paraadijaas errors, kad vinjam nav tiesiibu rakstiit MySQL temp failaa, atrisinaaju arii to un viss aizgaaja!! :) Tieshaam liels paldies!! :) Link to comment Share on other sites More sharing options...
bubu Posted January 14, 2006 Report Share Posted January 14, 2006 Baksti man kautvai acī, bet ORDER BY es tur neredzu :) Tā iet, ka nepārbauda fju atgrieztos rezultātus un programmē bez E_ALL un/vai display_errors=Off Link to comment Share on other sites More sharing options...
Roboc Posted January 15, 2006 Author Report Share Posted January 15, 2006 aa, sorry, sheit biju ielicis iiso versiju, veel bij otrs variants, kur ir arii ORDER BY!! :) Ok, turpmaak zinaashu, kad vajag arii paarbaudiit pret erroriem, lai nebuutu jauzdod tik stulbi jautaajumi!! :) Link to comment Share on other sites More sharing options...
Recommended Posts