Hi
I have 2 tables in my database startdate and enddate, when the enddate has passed the startdate i want to update my database but can not get this to output the correct data, here is the code im using.
Here is my query
$req = mysql_query("select * from offers where price>0 and enddate < startdate and shopname='" . $_GET['shopname'] . "' ");
while($row= mysql_fetch_array($req))
{
?>
</span>
</p>
<table width="1157" height="70" align="center" class="alert" id="main2">
<tr>
<td width="7" height="64"> </td>
<td width="1131"><ul>
<table width="987">
<tr>
<td width="72" height="125"><img src="../app/images/products/<?php echo $row['image'] ?>" alt="" class="caption" style="width:50px; margin-right:6px" /></td>
<td width="903"><table width="96%" height="46" class="table-bordered">
<tr>
<td height="19" class="alert-danger">Offer name</td>
<td class="alert-danger">Start Date</td>
<td class="alert-danger">End Date</td>
<td class="alert-danger">Price</td>
<td class="alert-danger">Expired</td>
<td class="alert-danger"> </td>
</tr>
<tr class="alert-info" id="result">
<td width="209" height="19" class="alert-info"><?php echo $row['name'] ?></td>
<td width="128" class="alert-info"><?php echo $row['startdate'] ?></td>
<td width="111"class="alert-info"><?php echo $row['enddate'] ?></td>
<td width="117"class="alert-info"><?php echo $row['price'] ?></td>
<td width="135"class="alert-info">
<?php if ( 'startdate' > 'enddate'){
echo "Offer Expired";
}
else if
( 'startdate' < '$enddate'){
echo "Offer Live";
} ?></td>
<td width="141"class="alert-info"><a href="profile.php?ID=<?php echo $row['ID']; ?>" class="large button green">Reset Offer</a></span></td>
</tr>
</table>
if i echo $row[‘startdate’] and endate i get this format Sunday January 26, 2014 that’s what i wont but it doesn’t work
IN the 2 tables in the database field i use varchar for startdate and the same for enddate do i need to change these to datetime
thanks