Weird Error with inserting year into Table Field.
Posted: Tue Jun 14, 2005 4:41 pm
so the $themonth and $theyear output correctly giving 06 and 2005. when it inserts them into the table StatsByMonth, the month field is 06 and the year field is 127. Help?
Code: Select all
$themonth = date("e;m"e;);
$theyear = date("e;Y"e;);
print $themonth.'<br>'.$theyear."e;<br>"e;;
$result = mysql_query( "e;SELECT * FROM StatsByMonth WHERE month='$themonth' AND year='$theyear'"e; );//
$row=mysql_fetch_array($result); //Store Record Of Data in $row
if ($rowї'id'] == "e;"e;)
{
mysql_query ("e;INSERT INTO StatsByMonth(Visitors, PageViews, Downloads, month, year) VALUES ('0', '0', '0', '$themonth', '$theyear')"e;)
or die(mysql_error());
print 'boo';
}
else
{
print 'woo';
}