Drewdle Posted January 23, 2011 Share Posted January 23, 2011 I have this script running: <?php $query = mysql_query("SELECT * FROM jobs WHERE event = 'Yes' ORDER BY title"); while ($row = mysql_fetch_array($query)) { ?> How do I check if a field is empty and NOT display it...? For instance it has a 'applied' field, if that is empty I dont want it to display, however I still need the event = 'Yes' part. Quote Link to comment Share on other sites More sharing options...
codefossa Posted January 23, 2011 Share Posted January 23, 2011 <?php $result = mysql_query("SELECT * FROM `jobs` WHERE `event` = 'Yes' AND `applied` != '' ORDER BY `title` ASC;"); while ($row = mysql_fetch_assoc($result)) { // Use } mysql_free_result($result); ?> Quote Link to comment Share on other sites More sharing options...
codefossa Posted January 23, 2011 Share Posted January 23, 2011 Meant to modify not quote. Quote Link to comment Share on other sites More sharing options...
Drewdle Posted January 23, 2011 Author Share Posted January 23, 2011 Thanks, your a saviour! Quote Link to comment Share on other sites More sharing options...
codefossa Posted January 23, 2011 Share Posted January 23, 2011 Thanks, your a saviour! No problem. Glad to help. 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.