Jump to content

[SOLVED] scheduled events


jakebur01

Recommended Posts

this what it is like when it is inserted

 

$Month=$_POST["Month"];
$Day=$_POST["Day"];
$Hour=$_POST["Hour"];
$Club=$_POST["Club"];
$Topic=$_POST["Topic"];
$Type=$_POST["Type"];
$Year=$_POST["Year"];


$Starttime = mktime($Hour, 0, 0, $Month, $Day, $Year);

I am having trouble.

 

$datet=date();
				$time=time();
				$db = mysql_connect("#", "#", "#");
mysql_select_db("#", $db);
$result = mysql_query("SELECT * FROM life_meeting WHERE `Endtime` > '$time' AND `Starttime` = '$datet' ORDER BY 'Starttime' desc limit 8", $db);

this one works fine for pulling all of the meetings that have not yet ended

 

$result = mysql_query("SELECT * FROM life_meeting WHERE `Endtime` > '$time' ORDER BY MeetingId desc limit 10", $db);

 

but I need to pull only todays meetings and on another page pull only the meetings for the month

 

Starttime is a unix timestamp of the meeting starting time and Endtime is the unix timestamp of the Meeting end time.

i tried this if statement and still could not make it happen.

$result = mysql_query("SELECT * FROM life_meeting WHERE `Endtime` > '$time' limit 8", $db);

while ($myrow = mysql_fetch_array($result))
{

$MeetingId = $myrow["MeetingId"];
$Type = $myrow["Type"];
$Username = $myrow["Username"];
$Club = $myrow["Club"];
$Topic = $myrow["Topic"];
$Starttime = $myrow["Starttime"];
$Endtime = $myrow["Endtime"];

$Starttime= date('Y-m-d H:i', $Starttime);
$if1=date('Y-m-d', $Starttime);
$if2=date('Y-m-d');


if ($if1==$if2)
{
echo "<small><b>$Starttime</b></small> - $Type<br /><b>$Club</b><br /><a href=\"test7.php?meeting=$MeetingId\"><small>$Topic</small></a><br /><small>$Username</small><br /><br />";
}
else
{
//echo "There are not yet any meetings scheduled for today.";
}

}

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.