hyster Posted November 29, 2010 Share Posted November 29, 2010 this code works fine if the conditions are absolute ( pass, fail or empty). im trying to make the fail work if its part of the query. ive tried %fail% but didnt work. $choice = strtoupper($rows['comments']); if($choice == "PASS"){ $bgc = "#ff25f0" ; } elseif($choice == "FAIL"){ $bgc = "#666666" ; }else{ $bgc = "#FF6600" ; } Quote Link to comment Share on other sites More sharing options...
requinix Posted November 29, 2010 Share Posted November 29, 2010 Try stripos. You can drop the strtoupper() if you use it. Quote Link to comment Share on other sites More sharing options...
hyster Posted November 29, 2010 Author Share Posted November 29, 2010 thanks requinix got it working with this $term = 'FAIL'; $comt = ($rows['comments']); $pos2 = stripos($comt, $term); if($choice == "PASS"){ $bgc = "#ff25f0" ; } elseif ($pos2 !== false){ $bgc = "#666666" ; }else{ $bgc = "#FF6600" ; } Quote Link to comment 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.