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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.