Trouble using getdate() stuff in if statement
Posted: Fri Jan 17, 2003 11:43 pm
The following code does not work for some reason. Could someone please help me.
No matter what the if statement, even if it is "$yearday==0" the script always does the if, not the else portion. If you would like to see the problem in action, go to http://www.ffgurus.net/topsites/index.p ... hitin&id=2 When you refresh, both of the hits in categories should increase, only the total does.
Code: Select all
$memberrow = mysql_fetch_row(mysql_query("SELECT * FROM main_topsites where id=$id"));
$dateInfo = getdate();
$yearday=$dateInfoї"yday"];
$year=$dateInfoї"year"];
$memberday="$memberrowї12]";
$memberyear="$memberrowї13]";
if ($yearday>$memberday || $year>$memberyear)
{
$memberrowї10]++;
mysql_query("UPDATE main_topsites set hitsin='1',hitsout='0',totalin='$memberrowї10]',day='$dateInfoїyday]',year='$dateInfoїyear]' where id=$id");
}
else
{
$memberrowї8]++;
$memberrowї10]++;
mysql_query("UPDATE main_topsites set hitsin='$memberrowї8]',totalin='$memberrowї10]' where id=$id");
}