Jump to content

Archived

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

abs0lut

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

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

All I can say is use print_r and echo to make sure all variables are being set properly.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • 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.