djmartins Posted November 23, 2005 Report Share Posted November 23, 2005 Ir tada iespeja ka no db neizvada vienaadus vaardus?Un ja jaa tad kaadaa veidaa? Link to comment Share on other sites More sharing options...
litt Posted November 23, 2005 Report Share Posted November 23, 2005 SELECT DISTINCT(name) FROM tabula Var izmantot arī GROUP BY Link to comment Share on other sites More sharing options...
djmartins Posted November 23, 2005 Author Report Share Posted November 23, 2005 Citu variantu nav?Sitais manupraat nestraada es ierakstu taa SELECT DISTINCT(Dators) FROM news un man vispar vairaak neko neizvada :) Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 23, 2005 Report Share Posted November 23, 2005 (edited) djmartins --> rokas liikas? variants ar DISTINCT straadaa gan :) jo ta ir standar SQL komanda neizvadiit to kas atkaartojas dotajaa laukaa preciizi ir: SELECT DISTINCT lauka_nosaukums FROM tabula ja ir vairaaki lauki tad SELECT DISTINCT sho_neatkatot, cits lauks FROM tabula un nevis DISTINCT(lauka nosaukums) Edited November 23, 2005 by Grey_Wolf Link to comment Share on other sites More sharing options...
djmartins Posted November 23, 2005 Author Report Share Posted November 23, 2005 a name vieta nekas nav jaraksta? Link to comment Share on other sites More sharing options...
bubu Posted November 23, 2005 Report Share Posted November 23, 2005 mysql_error() pārbaudīji? Link to comment Share on other sites More sharing options...
djmartins Posted November 23, 2005 Author Report Share Posted November 23, 2005 (edited) a man errorus cip nemet aaraa!Un man nemaz pasam sava db nav :D karoc man sitaa izskataas! <? $host == "localhost"; $port == "3306"; $user == "rekets"; $pass == "challenge"; $database == "news"; $db = mysql_connect("$host:$port", "$user", "$pass"); $result = mysql_query("SELECT DISTINCT Padomi FROM news ",$db); while ($res = mysql_fetch_array($result)) { echo("<a href=\"category_id.php?cat=$res[cat]\"><font color=#000080>[ $res[7]] </a></font>"); } ?> kluda? Edited November 23, 2005 by djmartins Link to comment Share on other sites More sharing options...
v3rb0 Posted November 23, 2005 Report Share Posted November 23, 2005 $res[7] ?? Link to comment Share on other sites More sharing options...
djmartins Posted November 23, 2005 Author Report Share Posted November 23, 2005 $res[7] ir kategorijas nosaukums un katru reizi ievietojot kadu textu saglabajas vina kategorija un taa rodas vienadas kategorijas un kad taisa kategoriju lapu kuraa izvada sis kategorijas ,ai apskatitu visus tekstus atseviski katrai kategorijai, no db izvada visus rows ar kategorijas nosaukumiem kuri atkartojas. Link to comment Share on other sites More sharing options...
v3rb0 Posted November 23, 2005 Report Share Posted November 23, 2005 tur tak ar drukatiem melniem burtiem uz gaisi zila fona tev rakstīts ka $res[7] ir selecta 'SELECT DISTINCT Padomi FROM news' rezultāta neeksistējoša kolona - tas selects atgriež 1nu kolonu un pie tās ar $res[0] tiec klāt. tas pats ar $res['cat'] Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 23, 2005 Report Share Posted November 23, 2005 (edited) tu tachu konkreeti paprasi DB selecteet TIKAI lauku Padomi SELECT DISTINCT Padomi FROM news kur tad radiisies $res[cat] un $res[7] kas buus 8 ieraksts no pieprasiitajiem piem: SELECT a,b,c,d,e,f,g,h FROM... tad $res[6]==$res['g'] -------- DESCENT noraada ja shajaa laukaa ieraksti atkartojas tad to RINDU nenjemt.... edit: v3rb0 pasteidzaas :) Edited November 23, 2005 by Grey_Wolf Link to comment Share on other sites More sharing options...
djmartins Posted November 23, 2005 Author Report Share Posted November 23, 2005 ee zajebis viss aizgaja pa visiem palidzejat tnx :) Link to comment Share on other sites More sharing options...
bubu Posted November 23, 2005 Report Share Posted November 23, 2005 Mācētu cilvēkie lietot error_reporting(E_ALL); (un display_errors = true), tad nebūtu te tik stulbi topiki kā šis. Link to comment Share on other sites More sharing options...
Klez Posted November 23, 2005 Report Share Posted November 23, 2005 topika nosaukums jau arii labais :D Link to comment Share on other sites More sharing options...
Recommended Posts