Hello gang,
I am quite new to php & MySQL and have been given the task of amending a website which has a database that is scripted to show
the latest 20 entries on a web page for the case studies section. This needs to be changed to show latest entries for the last 3
months instead without deleting anything from the database. Here is the script as it stands:
while ($release = mysql_fetch_array($case))
{
if ($count > 20) break; //don't show more than 20 docs
$logo = "./assets/pics/agents/".$release['agent_id'].".jpg";
$agent = $db->getAgent($release['agent_id']);
$res = $db->getImagesByDocument($release['id']);
$has_images = false;
while ($a = mysql_fetch_assoc($res)) $has_images = true;
$aFeatures = array();
$doctype = substr($release['filename'],-3,3);
for ($i=0;$i<=20;$i++)
{
Also, a function seems to have been used and required once from a file dbobj.php to call up from the database:
function getCaseStudies()
{
$this->query = "SELECT * FROM document WHERE type_id='case' ORDER BY date_created DESC;";
$rs = mysql_query($this->query);
return ($rs);
}
I have tried using the time stamp function but I couldn't figure out how not to pinpoint specific months instead of just the 3 month
period.
Here is the URL: http://affordablehomeowndership.myzen.co.uk/v1.8/
Any help will be greatly appreciated. Kind regards, RTB.