bob2006 Posted December 13, 2010 Share Posted December 13, 2010 i am pulling the login date from the databases and i want it to check if the variable is empty and if it is echo Never Loged In and if it not empty echo the date <?php include'db.php'; $id=$_GET['id']; $sql=mysql_query("SELECT * FROM admin WHERE id='$id'")or die(mysql_error()); while($row=mysql_fetch_array($sql)) { $date=$row['login_date']; if($date > 0) { echo"Never Loged In"; } else { echo"$date"; } } ?> Link to comment https://forums.phpfreaks.com/topic/221460-check-if-php-variable-is-empty/ Share on other sites More sharing options...
Anti-Moronic Posted December 13, 2010 Share Posted December 13, 2010 if(empty($date)) Link to comment https://forums.phpfreaks.com/topic/221460-check-if-php-variable-is-empty/#findComment-1146443 Share on other sites More sharing options...
bob2006 Posted December 13, 2010 Author Share Posted December 13, 2010 Thanks Link to comment https://forums.phpfreaks.com/topic/221460-check-if-php-variable-is-empty/#findComment-1146444 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.