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

  Quote

$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:

  Quote

$timestamp = mktime (1,1,1,$date[1],$date[2],$date[0]);

 

 

Error from the ATS is the following:

 

  Quote
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

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

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

 

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.