Is it possible to have a image that will change if an sql record is created since the last visit of that registerd user and another image if criteria not met.
The record table is matningar with a date field datum.
Maybe the below code something close to achieving this?!
<?php
$stmt = "SELECT * FROM matningar WHERE `datum` > date("F j, Y, g:i a", $database- >getLastUserRegisteredDate()";
$result=mysql_query($stmt);
foreach($result as $rec){
echo "<img src=\"images/somepicture.png\" />";
}
?>
Would really appreciate some input on how to proceed!
You could count the records returned and use conditional statements to determine what image you want to display. For example using your code:
Just as a side note mysql functions are going to be depreceated in upcoming PHP releases so I would start looking at using the PDO or mysqli libraries for mysql queries.