Jump to content

[SOLVED] Warning: mktime() expects parameter 6 to be long, string given in


abs0lut

Recommended Posts

<?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

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());
		}
	}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.