jwer78 Posted November 13, 2007 Share Posted November 13, 2007 I need to run a check to see if an array is null. Here is the section I am having problems with. Any help would be greatly appreciated. $bowl_query=mysql_query($bowl_sql); while($bowl_array=mysql_fetch_array($bowl_query)){ $amt=$bowl_array['subtrans_paid']; if($bowl_array='NULL'){ $bowl_award="DUE"; } if($amt > '3.00'){ $bowl_award="Yes"; }else{ $bowl_award="No"; } Link to comment https://forums.phpfreaks.com/topic/77072-check-if-an-array-is-null/ Share on other sites More sharing options...
PHP_PhREEEk Posted November 13, 2007 Share Posted November 13, 2007 NULL is a PHP constant, not a string. Remove the single quotes from around it if($bowl_array = NULL) PhREEEk Link to comment https://forums.phpfreaks.com/topic/77072-check-if-an-array-is-null/#findComment-390298 Share on other sites More sharing options...
cooldude832 Posted November 13, 2007 Share Posted November 13, 2007 why not just check before you do a while loop by saing if(mysql_num_rows($bowl_query) >0){ while/// }//end while }//end if else{ no results } Link to comment https://forums.phpfreaks.com/topic/77072-check-if-an-array-is-null/#findComment-390323 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.