ok, I should know this,, all I want this script to do, is take information from a database and post it for the same day,, and not tomorrow... like items posted today,,,,
here the code I have,, some of it, I dont even think I need... like the date stop....
[php]
<?
$d = date("m|d|Y");
$que = "SELECT * FROM class_item WHERE d_start='$d'";
$res = mysql_query($qu);
$num = mysql_num_rows($re);
while($ro = mysql_fetch_array($res)){
$dur = 7;
list($m,$d,$y)= split ("\|", $ro['d_start'], 3);
list($dd,$mm,$yyyy) = split("-",date("d-m-Y",time()));
$today = mktime(0, 0, 0, $mm, $dd, $yyyy);
$d_end = mktime(0, 0, 0, date("m"), date("d")+$dur, date("y"));
$ds = date('m/d/Y',$d_end);
if($ds <= $today){
echo '
<TABLE CELLSPACING="0" CELLPADDING="4" BORDER="0" WIDTH="100%"><TR><TD ALIGN="left" VALIGN="TOP" WIDTH="20%">
<a href="http://'.$domain.'/c/results.php?desc=1&id='.$row['id'].'">
<img src="http://'.$domain.'/c/image/'.$ro[image].'" border="0" height="60" width="60"></a>
</td><td>
<font size="2"><b> <a href="http://'.$domain.'/c/description.php?id='.$ro['id'].'">'.$ro[title].'</a></B></font>
</td></tr></table>
<HR>
';
}else{
echo "Sorry, No Ads for ".$ro['d_start']."!";
}
}
?>
[/php]
Any suggestions?
here the code I have,, some of it, I dont even think I need... like the date stop....
[php]
<?
$d = date("m|d|Y");
$que = "SELECT * FROM class_item WHERE d_start='$d'";
$res = mysql_query($qu);
$num = mysql_num_rows($re);
while($ro = mysql_fetch_array($res)){
$dur = 7;
list($m,$d,$y)= split ("\|", $ro['d_start'], 3);
list($dd,$mm,$yyyy) = split("-",date("d-m-Y",time()));
$today = mktime(0, 0, 0, $mm, $dd, $yyyy);
$d_end = mktime(0, 0, 0, date("m"), date("d")+$dur, date("y"));
$ds = date('m/d/Y',$d_end);
if($ds <= $today){
echo '
<TABLE CELLSPACING="0" CELLPADDING="4" BORDER="0" WIDTH="100%"><TR><TD ALIGN="left" VALIGN="TOP" WIDTH="20%">
<a href="http://'.$domain.'/c/results.php?desc=1&id='.$row['id'].'">
<img src="http://'.$domain.'/c/image/'.$ro[image].'" border="0" height="60" width="60"></a>
</td><td>
<font size="2"><b> <a href="http://'.$domain.'/c/description.php?id='.$ro['id'].'">'.$ro[title].'</a></B></font>
</td></tr></table>
<HR>
';
}else{
echo "Sorry, No Ads for ".$ro['d_start']."!";
}
}
?>
[/php]
Any suggestions?
