• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error in Array to string conversion

#11
Developer Tools.
In your web browser hit F12 and click on console tab and you should be able to see what is going on.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#12
Code:
$uploadDate = '2016-10-20';
$date = strtotime($uploadDate);
$date = strtotime("+3 day", $date);
$date = date('Y-m-d', $date);
echo $date;

on this url. It looks as a clear block of coding. Can this help out? And using capital letters for "Years" in your code. Would it be a problem? I have no personal experience in typing this "+ years" but so far, I have always seen lower case.
Reply

#13
what's on line 271 in your controller?
Reply

#14
(06-12-2019, 04:31 PM)hc-innov Wrote: what's on line 271 in your controller?

line 271 in my controller says
$this->Model_user->model_add_new_emp($data, $data_retire_tbl);

Now What ever the DOB I entered, it takes 1970-01-01 as $due_date_retire and entered it into database.
It doesnot add 60 years to DOB.
Sad
Reply

#15
Solution of Wouter60 must work:

PHP Code:
$dob $this->input->post('dob');
$due_date_retire date('Y-m-d'strtotime($dob.'+60 years')); 
Reply

#16
it works, but it returns 1970-01-01 as $due_date_retire for any dob.
It doesnot add 60 years to dob.
Sad
Reply

#17
test your value of $this->input->post('dob');


PHP Code:
var_dump($this->input->post('dob');
die(); 
Reply

#18
(06-13-2019, 02:40 AM)hc-innov Wrote: test your value of $this->input->post('dob');


PHP Code:
var_dump($this->input->post('dob');
die(); 

it says
string(10) "1996-12-23"
Reply

#19
strange, it's good value and good type...
PHP Code:
$dob $this->input->post('dob');
var_dump($dob);
$due_date_retire date('Y-m-d'strtotime($dob.'+60 years')); 
var_dump($due_date_retire);
die(); 
Reply

#20
(06-13-2019, 03:00 AM)hc-innov Wrote: strange, it's good value and good type...
PHP Code:
$dob $this->input->post('dob');
var_dump($dob);
$due_date_retire date('Y-m-d'strtotime($dob.'+60 years')); 
var_dump($due_date_retire);
die(); 

it says
string(10) "1996-12-23"
string(10) "1970-01-01"
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
2 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.