Andy92
07-29-2006, 10:23 PM
Hi there,
On my site admin panel i have an adverts section where there is a php script in that page and it gets data from a mysql database called adverts and displays it in the adverts.php file. Also it orders it by what day and month each customers advertising package is due to expire.
Here is the php script i have in my page...
<?php
mysql_connect("localhost", "web15-mainsite", "passwordnewass") or die(mysql_error());
mysql_select_db("web15-mainsite") or die(mysql_error());
$result = mysql_query("SELECT * FROM adverts ORDER BY mn ASC, finday ASC");
if ($row2 = mysql_fetch_array($result)) {
do {
Printf("<tr><td width='157'><div align='left'>%s</div></td>
<td width='159'><div align='left'>%s</div></td>
<td width='126'><div align='left'>%s</div></td>
<td width='138'><div align='left'>%s</div></td></tr>", $row2[name],$row2[package], $row2[start], $row2[finish]);
}while ($row2 = mysql_fetch_array($result));
}else{
echo "No Adverts at the moment";
}
?>
Basically, could someone tell me how to add to the script, so that it would still order it by the date due to each advertising package expires, but the script would sense the present date, and then if the customers advertising package has expired then it would display the 'finish' date text in red and bold so then i will be able to know if it has expired?
Please help? :confused:
On my site admin panel i have an adverts section where there is a php script in that page and it gets data from a mysql database called adverts and displays it in the adverts.php file. Also it orders it by what day and month each customers advertising package is due to expire.
Here is the php script i have in my page...
<?php
mysql_connect("localhost", "web15-mainsite", "passwordnewass") or die(mysql_error());
mysql_select_db("web15-mainsite") or die(mysql_error());
$result = mysql_query("SELECT * FROM adverts ORDER BY mn ASC, finday ASC");
if ($row2 = mysql_fetch_array($result)) {
do {
Printf("<tr><td width='157'><div align='left'>%s</div></td>
<td width='159'><div align='left'>%s</div></td>
<td width='126'><div align='left'>%s</div></td>
<td width='138'><div align='left'>%s</div></td></tr>", $row2[name],$row2[package], $row2[start], $row2[finish]);
}while ($row2 = mysql_fetch_array($result));
}else{
echo "No Adverts at the moment";
}
?>
Basically, could someone tell me how to add to the script, so that it would still order it by the date due to each advertising package expires, but the script would sense the present date, and then if the customers advertising package has expired then it would display the 'finish' date text in red and bold so then i will be able to know if it has expired?
Please help? :confused: