Hey guys/girls.
I have tow bits of code here, the top one works fine with Y-m-d date logging, but the other one im trying just to get the month and year.
When the second one is logged into the database it's just 000-00-00 .PHP Code:$time = date ( "Y-m-d" );
$time2 = date ( "Y-m" );
// First
if(@mysql_fetch_array(@mysql_query("SELECT date FROM adsl_counter2 WHERE date='$time'"))) {
@mysql_query("UPDATE adsl_counter2 set count=count+1 WHERE date='$time'");}
else { mysql_query("INSERT INTO adsl_counter2 SET date=NOW(), count='1'");}
// Second
if(@mysql_fetch_array(@mysql_query("SELECT date FROM adsl_counter4 WHERE date='$time2'"))) {
@mysql_query("UPDATE adsl_counter4 set count=count+1 WHERE date='$time2'");}
else { mysql_query("INSERT INTO adsl_counter4 SET date=NOW(), count='1'");}
Any help would be great.![]()





Bookmarks