Need to know how to set ad listings to expire 30 days in php mysql? PHP

I need to know how to set ad listings to expire 30 days in php mysql?
i know i have to ad some kind of feids in the myql table of listings

here is my php code to the page where it displays the for sale listings and catagories
[php]


Category : <? echo "$category";?> <? $query = "SELECT COUNT(*) FROM forsale_content WHERE category='$category' AND status='online'"; $numentries = mysql_query($query) or die("Select Failed!"); $numentry = mysql_fetch_array($numentries); ?>
Click on title to view description
<? $sql = "SELECT * FROM forsale_content WHERE category='$category' AND status='online' ORDER BY id DESC"; $result = mysql_query($sql); while ($record = mysql_fetch_object($result)) { $question = nl2br($record->description); $answer = nl2br($record->answer); ?>
id";?>"><? echo "$record->title"; ?><?php if($record->price != "") { ?> - $<? echo number_format($record->price);?> <?php } ?> (<? echo "$record->city"; ?>) (<? echo "$record->postdate";?>)
<? } ?>[/php]

here is the mysql table for the listing content
[embed=425,349]CREATE TABLE IF NOT EXISTS forsale_content (
id int(11) NOT NULL AUTO_INCREMENT,
postdate date DEFAULT NULL,
posttime varchar(10) DEFAULT NULL,
name varchar(250) DEFAULT NULL,
phone varchar(250) DEFAULT NULL,
address varchar(250) DEFAULT NULL,
city varchar(255) DEFAULT NULL,
country varchar(250) DEFAULT NULL,
email varchar(250) DEFAULT NULL,
website varchar(250) DEFAULT NULL,
title varchar(250) DEFAULT NULL,
price varchar(250) DEFAULT NULL,
description text,
category varchar(250) DEFAULT NULL,
photo varchar(250) DEFAULT NULL,
status varchar(250) DEFAULT NULL,
password varchar(25) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=46 ;[/embed]

Your REAL problem is you are using dangerous obsolete code that has been removed from current Php versions. You need to use PDO with Prepared Statements.

https://phpdelusions.net/pdo

Sponsor our Newsletter | Privacy Policy | Terms of Service