Welcome Guest, Not a member yet? Register   Sign In
I found several oddities in CI4.3.3...
#1

I found several oddities in CI4.3.3...
1)
//return redirect()->to('login');//doesn't work replaced by the line below which works fine
header("Location:".base_url('login'));//BYOOS_tag
exit();

2)
//Insert record in table does not work
$this->builder = $this->db->prefixTable($this->table)
$success = $this->builder->insert($data);
//
//Insert record in table works fine
$this->db = \Config\Database::connect();
$DBPrefix = $this->db->getPrefix();
$this->builder = $this->db->table($DBPrefix.$this->table);

one more for the road
3)
//Table to return to the controller
MODELS Employee object(stdClass)#211 (19) { ["username"]=> string(15) "[email protected]" ["password"]=> string(60) "$2y$10$jq98SQCnYwScKCfaaHLCUew7vSXFBbAXLgv1xpshvYpOGHZGAUN0S" ["person_id"]=> string(1) "1" ["deleted"]=> string(1) "0" ["hash_version"]=> string(1) "2" ["language"]=> string(0) "" ["language_code"]=> string(0) "" ["first_name"]=> string(7) "Digital" ["last_name"]=> string(5) "Byoos" ["gender"]=> string(1) "1" ["phone_number"]=> string(13) "+237696654756" ["email"]=> string(20) "support@byoosdigital" ["address_1"]=> string(9) "Address 1" ["address_2"]=> string(0) "" ["city"]=> string(0) "" ["state"]=> string(0) "" ["zip"]=> string(0) "" ["country"]=> string(0) "" ["comments"]=> string(0) "" }

// call the controller to the model

$person_info = $this->employee->get_info($employee_id);
// breakpoint
echo ' CONTROLLER Employee ';var_dump($this->employee->get_info($employee_id), $employee_id, gettype($person_info));die;//BYOOS_tag

//the controller gets NULL array values???

CONTROLLER Employee object(stdClass)#144 (19) { ["first_name"]=> NULL ["last_name"]=> NULL ["gender"]=> int(0) ["phone_number"]=> NULL ["email"]=> NULL ["address_1"]=> NULL ["address_2"]=> NULL ["city"]=> NULL ["state"]=> NULL ["zip"]=> NULL ["country"]=> NULL ["comments"]=> NULL ["person_id"]=> NULL ["username"]=> NULL ["password"]=> NULL ["deleted"]=> NULL ["hash_version"]=> NULL ["language"]=> NULL ["language_code"]=> NULL } int(- 1) string(6) "object"

for point 3) I'm still looking, it's unheard of for me ho
.
bye Gabriel
Translated with www.DeepL.com/Translator (free version)
Reply
#2

See the Important note: https://codeigniter4.github.io/CodeIgnit...onstructor

See https://codeigniter4.github.io/CodeIgnit...refixtable
Reply




Theme © iAndrew 2016 - Forum software by © MyBB