Lokomotive Posted January 15, 2005 Report Share Posted January 15, 2005 (edited) Lieta tāda, ka priekš ORDER BY izmantoju ASC, un zortēju pēc mācību stundas kārtas skaitļa, kas ir no 1 līdz 10). Taču dati tiek izvadīti secībā: 1 10 2 3 4 5 6 7 8 9 nevis 1 2 3 4 5 6 7 8 9 10 - izņemot ASC un DESC, iekš Mysql citu zortēšanas iespēju nemaz nav, manuprāt. Bet varbūt ir? mysql_query("SELECT * FROM saraksts WHERE klase='$klase' AND diena_sk='$sk' ORDER BY `stunda_sk` ASC ") or die("!DB"); while($pirmdiena = mysql_fetch_array($dati)){ echo' <tr><td>'.$pirmdiena['stunda'].'</td></tr>'; } Edited January 15, 2005 by Lokomotive Link to comment Share on other sites More sharing options...
bubu Posted January 15, 2005 Report Share Posted January 15, 2005 Visdrīzāk tas nozīme, ka tev kolonas stunda_sk tips ir strings, nevis skaitlis. Pamēģini šādi: SELECT * FROM saraksts WHERE klase='$klase' AND diena_sk='$sk' ORDER BY stunda_sk+0 ASC Link to comment Share on other sites More sharing options...
Lokomotive Posted January 15, 2005 Author Report Share Posted January 15, 2005 paldies bubu! Link to comment Share on other sites More sharing options...
Recommended Posts