I’m having a bit of trouble inserting the following
[php]
if($ad_price == 10) { $renew = date(‘Y-m-d’, strtotime(’+6 months’)); }
if($ad_price == 20) { $renew = date(‘Y-m-d’, strtotime(’+1 year’)); }
$query_add = “INSERT INTO listings (renew_date)
Values (’$renew’)”;
$add = mysql_query($query_add, $connect) or die(mysql_error());
[/php]
when the sql is set on date its entering 0000-00-00 when its set on text its entering -1900
I have tried echoing it to see if the outputs are ok and they are
[php]
<?php if($ad_price == 10) { $renew = date('d-m-Y', strtotime('+6 months')); } if($ad_price == 20) { $renew = date('d-m-Y', strtotime('+1 year')); } ?><?php echo $renew ?> [/php]
Does anybody have any suggestion