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. Link to comment https://forums.phpfreaks.com/topic/225374-check-mysql-field/ 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); ?> Link to comment https://forums.phpfreaks.com/topic/225374-check-mysql-field/#findComment-1163863 Share on other sites More sharing options...
codefossa Posted January 23, 2011 Share Posted January 23, 2011 Meant to modify not quote. Link to comment https://forums.phpfreaks.com/topic/225374-check-mysql-field/#findComment-1163864 Share on other sites More sharing options...
Drewdle Posted January 23, 2011 Author Share Posted January 23, 2011 Thanks, your a saviour! Link to comment https://forums.phpfreaks.com/topic/225374-check-mysql-field/#findComment-1163878 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. Link to comment https://forums.phpfreaks.com/topic/225374-check-mysql-field/#findComment-1163882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.