24. januar 2002 - 18:32
Der er
8 kommentarer og 1 løsning
fejl i sortering
Kan ikke få 'lortet' til at sortere tal.... Den vil gerne sortere tal bare de ikke er over 2 cifre !!!!! Er der ikke en der kan hjælpe mig... $get_stil = mysql_query("SELECT * FROM stilling ORDER BY stil_k DESC");
Annonceindlæg fra Salesforce
24. januar 2002 - 18:43
#5
Her er scriptet: <? session_start(); mysql_connect("xxxxx","xxxxxx","xxxx"); mysql_select_db("xxxxxx"); if($sort == ""){$sort = "stil_point";} if($dir == ""){$dir = "DESC";} ?> <table width="590" cellspacing="1" cellpadding="0" bgcolor="black"> <tr ><td> <table cellspacing="1" cellpadding="0" width="100%"> <td ALIGN=CENTER WIDTH="10" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_point&dir=DESC" onFocus="blur()">NR.</a></td> <td ALIGN=center WIDTH="215" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"> KLUB</td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_k&dir=DESC" onFocus="blur()">K</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_v&dir=DESC" onFocus="blur()">V</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_svv&dir=DESC" onFocus="blur()">SV-V</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_u&dir=DESC" onFocus="blur()">U</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_svt&dir=ASC" onFocus="blur()">SV-T</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_t&dir=ASC" onFocus="blur()">T</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stilmaal&dir=DESC" onFocus="blur()">+</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_maalimod&dir=ASC" onFocus="blur()">-</a></td> <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_point&dir=DESC" onFocus="blur()">P</a></td> <? $taeller=1; $get_stil = mysql_query("SELECT * FROM stilling ORDER BY '$sort' $dir"); while ($result_stil = mysql_fetch_array($get_stil)) { $Tid = $result_stil["stil_id"]; $Tkampe = $result_stil["stil_k"]; $Tvundne = $result_stil["stil_v"]; $Tu = $result_stil["stil_u"]; $Tsvv = $result_stil["stil_svv"]; $Tsvt = $result_stil["stil_svt"]; $Ttabt = $result_stil["stil_t"]; $Tmaal = $result_stil["stil_maal"]; $Tmaalimod = $result_stil["stil_maalimod"]; $Tpoint = $result_stil["stil_point"]; $Tklub = $result_stil["stil_klub"]; echo " <tr onmouseover=rowOver(); onmouseout=rowOut(); bgcolor=\"#DCDCDC\"> <td ALIGN=CENTER WIDTH=\"10\" > $taeller</td> <td ALIGN=LEFT WIDTH=\"215\" > $Tklub</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tkampe</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tvundne</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tsvv</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tu</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tsvt</td> <td ALIGN=CENTER WIDTH=\"50\" >$Ttabt</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tmaal</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tmaalimod</td> <td ALIGN=CENTER WIDTH=\"50\" >$Tpoint</td>"; $taeller++; } ?>
24. januar 2002 - 18:52
#8
Fandt selv fejlen... <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stilmaal&dir=DESC" onFocus="blur()">+</a></td> Skulle være: <td ALIGN=CENTER WIDTH="50" HEIGHT="18" BGCOLOR="#0F0979"><font color="white"><a href="?sort=stil_maal&dir=DESC" onFocus="blur()">+</a></td>