TG SH4RPY Posted February 8, 2010 Share Posted February 8, 2010 Can someone tell me the error and how the data is exploded. in this code $this->ipsclass->DB->simple_exec(); while ($row = $this->ipsclass->DB->fetch_row()) { $date = explode("-",$row[$this->funct->cfield['LEA']['SQL']],3); $timestamp = mktime (1,1,1,$date[1],$date[2],$date[0]); $today = getdate(); if (($today[0] - $timestamp) >= (60*60*24*30*6))//60 sec, 60min, 24 hours, 30 days, 6 months { $count_validations++; if ($row[$this->funct->cfield['DIV']['SQL']] == $this->ipsclass->member[$this->funct->cfield['DIV']['SQL']]) { $count_division++; } } } I know the error is on line 51, which is in here somewhere Error line is the following: $timestamp = mktime (1,1,1,$date[1],$date[2],$date[0]); Error from the ATS is the following: Warning: mktime() expects parameter 6 to be long, string given in /home/tghqorg/subsites/twhq/ats/wrapper/modules/info_hud_pending_discharge.php on line 51 Quote Link to comment https://forums.phpfreaks.com/topic/191298-can-someone-tell-me-the-error-and-how-the-data-is-exploded-in-this-code/ Share on other sites More sharing options...
teamatomic Posted February 8, 2010 Share Posted February 8, 2010 print_r($date) HTH TEamatomic Quote Link to comment https://forums.phpfreaks.com/topic/191298-can-someone-tell-me-the-error-and-how-the-data-is-exploded-in-this-code/#findComment-1008620 Share on other sites More sharing options...
TG SH4RPY Posted February 8, 2010 Author Share Posted February 8, 2010 What does that mean , im kinda new to coding Quote Link to comment https://forums.phpfreaks.com/topic/191298-can-someone-tell-me-the-error-and-how-the-data-is-exploded-in-this-code/#findComment-1008625 Share on other sites More sharing options...
teamatomic Posted February 8, 2010 Share Posted February 8, 2010 print_r will echo out the array. That way you can see what is returned so you can get a better idea of what is wrong. So right after you get the $date put this print_r($date); exit; and the paste the results here. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/191298-can-someone-tell-me-the-error-and-how-the-data-is-exploded-in-this-code/#findComment-1008628 Share on other sites More sharing options...
TG SH4RPY Posted February 8, 2010 Author Share Posted February 8, 2010 so it looks like this ? $timestamp = mktime (1,1,1,$date[1],$date[2],print_r($date); exit;); Quote Link to comment https://forums.phpfreaks.com/topic/191298-can-someone-tell-me-the-error-and-how-the-data-is-exploded-in-this-code/#findComment-1008630 Share on other sites More sharing options...
teamatomic Posted February 8, 2010 Share Posted February 8, 2010 To figure out why the error is happening we need to know the actual value of $date. I'm a bit confused cause you are exploding $date, that means a string yet in the mktime() statement you treat it as an array. I want to know the value $date right after you obtain it, from wherever you obtain it. So directly after this line I would like you to put the print_r and exit; $date = explode("-",$row[$this->funct->cfield['LEA']['SQL']],3); print_r($date); exit; Then whatever it return to you post it here HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/191298-can-someone-tell-me-the-error-and-how-the-data-is-exploded-in-this-code/#findComment-1008632 Share on other sites More sharing options...
teamatomic Posted February 8, 2010 Share Posted February 8, 2010 I misspoke in the previous post. I meant to say I think that maybe the result of $date is not 3 pieces but being returned as one or two. HTH Teamaotmic Quote Link to comment https://forums.phpfreaks.com/topic/191298-can-someone-tell-me-the-error-and-how-the-data-is-exploded-in-this-code/#findComment-1008643 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.