todayme Posted March 13, 2007 Share Posted March 13, 2007 Notice below I am trying to say in the code is If ($doit['Status'] == "") if its empty do assign a value. But it never thinks its empty when it is. Is this how you check if it is empty? $query = "select max(ID) from _Replies where LINKID = '$LeadID' AND SenderID = '$findID'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result) or die(mysql_error()); foreach($row as $key => $val) { $data = mysql_query("SELECT * FROM _Replies WHERE ID = '$val'") or die(mysql_error()); $doit = mysql_fetch_array($data); If ($doit['Status'] == "") { $coolstatus = "New Lead"; } else; { $coolstatus = $doit['Status']; } Link to comment https://forums.phpfreaks.com/topic/42582-cant-work-out-why-if-its-not-an-empty-variable-what-is-it/ Share on other sites More sharing options...
boo_lolly Posted March 13, 2007 Share Posted March 13, 2007 if(empty($doit['Status'])){ //do something } Link to comment https://forums.phpfreaks.com/topic/42582-cant-work-out-why-if-its-not-an-empty-variable-what-is-it/#findComment-206638 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.