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"; } } ?> Quote 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)) Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.