Jump to content

mktime() expects parameter 4 to be long


thejdawg

Recommended Posts

I'm an extreme newbie and have this current error on my site.

 

The error states: Warning: mktime() expects parameter 4 to be long, string given in featured_product.php on line 75

 

<?php 
                  for ($i = 0; $i < $num_rows; $i++) 
                    {
                        $id = mysql_result($result,$i,"id");
                        
                        $title = mysql_result($result,$i,"title");
                        
                        $featured = mysql_result($result,$i,"featured");
                        $feature_date = mysql_result($result,$i,"feature_date");
                        $feature_date_arr = explode("-",$feature_date);
                        $feat_date = mktime(0,0,0,$feature_date_arr[0],$feature_date_arr[1],2000+$feature_date_arr[2]);
                        if ( ($feat_date+($featured*24*60*60))<time() ) {
                            $db2->query("UPDATE product_catalog SET featured = 0 WHERE id='$id'");
                            $featured = 0;
}
                        else
{
                            $featured = 1;
                            $db2->query("UPDATE product_catalog SET featured = 1 WHERE id='$id'");

}
                
                    
                    ?>

 

Any ideas on how to correct this?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/225112-mktime-expects-parameter-4-to-be-long/
Share on other sites

What this is suppose to do is a member can feature a product "art or photography" for a certain amount of days which shows on the home page. So the test was suppose to be a a bunch of products on the home page which lasted 24 hours. That part worked but in my admin under the featured products I receive the 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.