I’m looking to extend the date to the next day, If the date is less than todays date.
here’s what I have.
$today = $date = date('y/d/m h:i:s a', time());
$query_moline = "SELECT * FROM penny WHERE `active`='Y' ORDER BY `sdate` ASC LIMIT 13";
$moline = mysql_query($query_moline) or die(mysql_error());
$row_moline = mysql_fetch_assoc($moline);
$totalRows_moline = mysql_num_rows($moline);
?>
<table width="98%"><tr><td>Title</td><td><?php echo $today ?></td><td>Fee</td></tr>
<? if($totalRows_moline>0)
{ ?>
<?php do { ?>
<?php
$id=$row_moline['id'];
$title=$row_moline['title'];
$sdate=$row_moline['sdate'];
$fee=$row_moline['fee'];
if($sdate<$today){
$sdate=$today;
$strsql="UPDATE `penny` SET `sdate`=\"$sdate\" WHERE `id`=\"$id\"";
//echo $strsql."<BR>";
mysql_query($strsql,$connect) or die(mysql_error());
}
Here’s where I’m stuck, if $sdate<$today then I need $sdate to be tomorrows date but with the same time as $sdate
for example if $sdate= 2011/4/12 14:00:00
then I need the new date to be 2011/5/12 14:00:00
You should try (if I understand what you need)