dezkit Posted June 7, 2008 Share Posted June 7, 2008 is it possible so that if there isnt an entry in the database, so it DOESNT show the "-" ? $altr = " class='row2'"; while($r = mysql_fetch_array($q)) { if($altr == " class='row2'") { $altr = " class='row1'"; } else { $altr = " class='row2'"; } $winner = split("-",$r['score']); Quote Link to comment https://forums.phpfreaks.com/topic/109151-need-help/ Share on other sites More sharing options...
DarkWater Posted June 7, 2008 Share Posted June 7, 2008 Please elaborate. Which - are you talking about? Also, why are you using split() when you can just explode()? split() works with regex separators, so it's kind of useless using split() with just a -. Quote Link to comment https://forums.phpfreaks.com/topic/109151-need-help/#findComment-559889 Share on other sites More sharing options...
dezkit Posted June 7, 2008 Author Share Posted June 7, 2008 the "-" in $winner = split("-",$r['score']); and i use split because i can Quote Link to comment https://forums.phpfreaks.com/topic/109151-need-help/#findComment-559905 Share on other sites More sharing options...
DarkWater Posted June 7, 2008 Share Posted June 7, 2008 What's actually stored in $r['score'] anyway? Quote Link to comment https://forums.phpfreaks.com/topic/109151-need-help/#findComment-559909 Share on other sites More sharing options...
dezkit Posted June 7, 2008 Author Share Posted June 7, 2008 TIE Quote Link to comment https://forums.phpfreaks.com/topic/109151-need-help/#findComment-559917 Share on other sites More sharing options...
dezkit Posted June 7, 2008 Author Share Posted June 7, 2008 TIE is stored.... Quote Link to comment https://forums.phpfreaks.com/topic/109151-need-help/#findComment-559947 Share on other sites More sharing options...
hansford Posted June 7, 2008 Share Posted June 7, 2008 $str = "abc-123-78ab-w"; $array1 = explode("-", $str); $array1[0] = 'abc' $array1[1] = '123' $array1[2] = '78ab' $array1[3] = 'w' Quote Link to comment https://forums.phpfreaks.com/topic/109151-need-help/#findComment-560076 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.