thejdawg Posted January 20, 2011 Share Posted January 20, 2011 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! Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 20, 2011 Share Posted January 20, 2011 No idea what's wrong without seeing the data you're passing to the mktime() function. Why are you using mktime()? Is the date not stored in a native MySQL DATE type data format? Quote Link to comment Share on other sites More sharing options...
thejdawg Posted January 20, 2011 Author Share Posted January 20, 2011 I didn't write the code and I have no idea. I am just learning, very early stages. I mean early. I had a programmer fix an issue, paid him but 24 hours later it doesn't work and of course he won't respond even though he is online. Quote Link to comment Share on other sites More sharing options...
thejdawg Posted January 20, 2011 Author Share Posted January 20, 2011 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. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 20, 2011 Share Posted January 20, 2011 Ok, but we'll still need to see the data that's being passed to the mktime() function to be able to really offer anything of value. Quote Link to comment Share on other sites More sharing options...
thejdawg Posted January 21, 2011 Author Share Posted January 21, 2011 Ok, finally figured out my issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.