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 Link to comment https://forums.phpfreaks.com/topic/117902-solved-warning-mktime-expects-parameter-6-to-be-long-string-given-in/ 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()); } } ?> Link to comment https://forums.phpfreaks.com/topic/117902-solved-warning-mktime-expects-parameter-6-to-be-long-string-given-in/#findComment-606483 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. Link to comment https://forums.phpfreaks.com/topic/117902-solved-warning-mktime-expects-parameter-6-to-be-long-string-given-in/#findComment-606488 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? Link to comment https://forums.phpfreaks.com/topic/117902-solved-warning-mktime-expects-parameter-6-to-be-long-string-given-in/#findComment-606544 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. Link to comment https://forums.phpfreaks.com/topic/117902-solved-warning-mktime-expects-parameter-6-to-be-long-string-given-in/#findComment-606548 Share on other sites More sharing options...
abs0lut Posted August 4, 2008 Author Share Posted August 4, 2008 thanks, topic solved. Link to comment https://forums.phpfreaks.com/topic/117902-solved-warning-mktime-expects-parameter-6-to-be-long-string-given-in/#findComment-607117 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.