abrahamgarcia27 Posted August 25, 2011 Share Posted August 25, 2011 I have a query that outputs certain values in a table, but i want to put a conditional if statement. What i have right now is if the status is 1 echo Close and if the status is 0 Open what i want it to do now is not to show the values that have 1 along with all the other database table entries how would i do that //if statement for status if($rows['status'] == 1) { $status = "Close"; } else $status = "Open"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/245660-if-statement/ Share on other sites More sharing options...
MasterACE14 Posted August 25, 2011 Share Posted August 25, 2011 $sql = "SELECT field1,field2,field3 WHERE `status`='1'"; Filter the results in the Query. Quote Link to comment https://forums.phpfreaks.com/topic/245660-if-statement/#findComment-1261715 Share on other sites More sharing options...
abrahamgarcia27 Posted August 25, 2011 Author Share Posted August 25, 2011 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/245660-if-statement/#findComment-1261723 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.