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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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