Jump to content

Can someone tell me the error and how the data is exploded. in this code


TG SH4RPY

Recommended Posts

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
Link to comment
Share on other sites

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

 

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.