abs0lut Posted August 3, 2008 Share Posted August 3, 2008 <?php $date1 = date("Y-m-d"); $query = mysql_query("SELECT closedate, topicstatus FROM topics") or die (mysql_error()); while($row = mysql_fetch_array($query)){ $date2=$row['closedate']; $topicstat=$row['topicstatus']; $date1_array = explode("-",$date1); $date2_array = explode("-",$date2); $now =mktime(0,0,0,$date1_array[1],$date1_array[2],$date1_array[0]); $close =mktime(0,0,0,$date2_array[1],$date2_array[2],$date2_array[0]); if(($now>close) && ($topicstat==0)){ $do = mysql_query("UPDATE topicsSET status=1") or die(mysql_error()); } } ?> please help me Quote Link to comment Share on other sites More sharing options...
abs0lut Posted August 3, 2008 Author Share Posted August 3, 2008 oops, I forgot space. <?php $date1 = date("Y-m-d"); $query = mysql_query("SELECT closedate, topicstatus FROM topics") or die (mysql_error()); while($row = mysql_fetch_array($query)){ $date2=$row['closedate']; $topicstat=$row['topicstatus']; $date1_array = explode("-",$date1); $date2_array = explode("-",$date2); $now =mktime(0,0,0,$date1_array[1],$date1_array[2],$date1_array[0]); $close =mktime(0,0,0,$date2_array[1],$date2_array[2],$date2_array[0]); if(($now>close) && ($topicstat==0)){ $do = mysql_query("UPDATE topics SET status=1") or die(mysql_error()); } } ?> Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted August 3, 2008 Share Posted August 3, 2008 All I can say is use print_r and echo to make sure all variables are being set properly. Quote Link to comment Share on other sites More sharing options...
abs0lut Posted August 3, 2008 Author Share Posted August 3, 2008 what will I print_r and echo? could you please explain further? Quote Link to comment Share on other sites More sharing options...
unkwntech Posted August 3, 2008 Share Posted August 3, 2008 I think he means: print_r($date1_array); print_r($date2_array); Then verify that each item in the array is what it should be. Quote Link to comment Share on other sites More sharing options...
abs0lut Posted August 4, 2008 Author Share Posted August 4, 2008 thanks, topic solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.