Jump to content

[SOLVED] how to display 'no activities'


kawai84

Recommended Posts

hi all... can anyone help me...

in this code, i wanna display 'today activities' to user..if the actvity's date=today, then the output will display the activites for today.

and if not, it should display 'no activities for today'

fyi, the 'else' part didnt work....which is display 'no activities for today'...

 

which part is missing...?

thanks..

 

<?php 	
      include ('mysql_connect.php'); 
  $today = (Date("d-m-Y"));
  $query = "SELECT id, title, date, date2, time, venue, detail, DATE_FORMAT(DATEnow, '%M %d, %Y') as sd FROM events
            WHERE date='$today'"; 
      $result = @mysql_query($query);

  if ($result) {  
  echo'<table align="center" border="0" width="95%">
  		<tr class="newstext">
		<td valign="center" align="left" class="newstext">';
      		while ($row = mysql_fetch_array($result)) {       		
      		echo '<p><img src="images/handr.gif">
		<a href="read_events.php?id='.$row['id'].'"><font size=2 face="verdana"><b> '.$row['title'].'</b></font></a><br>';			 			
    		}
        echo'</td</tr></table>';	    
      } else {
      	 echo '<font face="verdana" size="2">No activities for today.</font>';  		 
      }

      ?> 

<link href="style.css" rel="stylesheet" type="text/css" /> 

Link to comment
https://forums.phpfreaks.com/topic/132975-solved-how-to-display-no-activities/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.