php error Message: Unsupported operand types


Hi, I'm doing a php operation with parentheses; and I get this error

error code:

  Fatal error: Unsupported operand types in 
   C:\xampp\htdocs\olPrueba2\application\controllers\Admin.php on line 705
   A PHP Error was encountered
    Severity: Error

    Message: Unsupported operand types

    Filename: controllers/Admin.php

    Line Number: 705


this is the line that says to have an error:


How can I solve it, the variables I take from the database with a method, is it a date type for that?

code of the method:

 public function getyearHire($roster_salesforcename){

  $this->db->where('roster_salesforcename', $roster_salesforcename);
  $data = $this->db->get('ol_roster');

  $response = $data->result();

   return $response;
asked by user80520 07.04.2018 в 00:56

1 answer


If the variables are dates you can not use the -. You have to use date_diff like this:

answered by 07.04.2018 / 01:43