MārisL Posted October 21, 2007 Report Share Posted October 21, 2007 Tātad man ir nepieciešams, lai no kollonas 'rezultati' izvelkot rezultātu tas iekrāsotos īstajā krāsā. Piem. 16:3 - Zaļā krāsā 3:16 - Sarkanā krāsā 15:15 - Zilā krāsā Nav pat nojausma kā to varētu izveidotot tādēļ prasu padomu jums. Link to comment Share on other sites More sharing options...
Delfins Posted October 21, 2007 Report Share Posted October 21, 2007 if (...) { } Link to comment Share on other sites More sharing options...
MārisL Posted October 21, 2007 Author Report Share Posted October 21, 2007 Varētu lūdzu pilnāku kodu? if (16:0, 16:1..) { color: #00800; } kaut kā tā? Link to comment Share on other sites More sharing options...
p4F Posted October 21, 2007 Report Share Posted October 21, 2007 <?php $result=13; if($result > 16) { echo "<font color='green'><b>$result</b></font>"; } else { echo "<font color='red'><b>$result</b></font>"; } ?> nu kautkā tā domāju sapratīsi Link to comment Share on other sites More sharing options...
zinatnieks Posted October 21, 2007 Report Share Posted October 21, 2007 if($rez1 > $rez2) { echo '<font color="green">'.$rez1.' : '.$rez2.'</font>'; } kur $rez1 un $rez2 ir izvilkti no datu bāzes Link to comment Share on other sites More sharing options...
MārisL Posted October 21, 2007 Author Report Share Posted October 21, 2007 <?php $result=mysql_query("SELECT id, valsts, pretinieks, karte, rez1, rez2 FROM cw_rezultati ORDER BY id DESC"); while($row = mysql_fetch_array($result, MYSQL_NUM)) { if($rez1 > $rez2) { echo '<font color="green">'.$rez1.' : '.$rez2.'</font>'; } echo "<table> <tr> <td> <a href='cw_komentaari.php?cw_id=$row[0]'><b>dAs.Tm vs <img src='http://www.mindtime.lv/nhl/das/karogi/$row[1].gif' alt='' border='0' /> $row[2]</a></b></td><td> @ $row[3] </td><td><b>$row[4]:$row[5]</b></td> </td> </tr></table>"; } ?> Kādēļ if nestrādā? Ieliekot kodu uzreiz pazūd visi row Link to comment Share on other sites More sharing options...
bubu Posted October 21, 2007 Report Share Posted October 21, 2007 Kas tev ir $rez1 un $rez2? Lūdzu ieslēdz error_reporting(E_ALL); un ini_set("display_errors", 1); Link to comment Share on other sites More sharing options...
p4F Posted October 21, 2007 Report Share Posted October 21, 2007 (edited) varbūt tapēc ka viņš neredz kas ir tas $rez1 if($row[4] > $row[5]) { echo '<font color="green">'.$row[4].' : '.$row[5].'</font>'; } mby pameigini tā Edited October 21, 2007 by p4F Link to comment Share on other sites More sharing options...
MārisL Posted October 21, 2007 Author Report Share Posted October 21, 2007 p4F paldies :) Link to comment Share on other sites More sharing options...
Recommended Posts