I'm still struggling making a menu with six links with images that differs depending on if a new record has ben added or not. I made a table which records the users clicks and the corresponding link_url and timestamp. I then want to compare the timestamp in the latest record in matningar containing the username and the matningstyp.
$query="SELECT max(click_timestamp) AS maxts FROM clicks WHERE username='$session->username' AND link_url='http://xxx/admin/amfmci.php'";
$result=mysql_query($query) or die(mysql_error());
$line = mysql_fetch_assoc($result);
$query1="SELECT max(datum) AS maxts FROM matningar WHERE kontakt='$session->username' AND matningstyp='bbb'";
$result1=mysql_query($query1) or die(mysql_error());
$line1 = mysql_fetch_assoc($result1);
$senasteclick = $line['maxts'];
$senastematning = $line1['maxts'];
if ('$senasteclick' > '$senastematning'){
echo "<a href=\"http://xxx/admin/amf.php\"><img src=\"http://xxx/admin/images/emoikon3.png\" alt=\"Digg\" width=\"64\" height=\"63\" border=\"0\"/></a>"; }
else {
echo "fail";
}
This does not work the way I want to. If I change the if statement to less than, the image changes.
If I change the date of record itself it does not change the image... So the code does not what I want it to do :(
Anyone got any ideas?