Welcome Guest, Not a member yet? Register   Sign In
Model refusing to insert data
#1

Hi all.

I am building a web app in CI4 and currently testing my register controller.

I can confirm the data is being read properly by $this->request->getPost() but when I go to save it with my user model, it simply doesn't do anything.

Please help me before I lose my sanity.

PHP Code:
  public function register()
  {
    $userModel = new UserModel();
    $data $this->request->getPost();
    try {
      $userModel->insert($data); // nothing happens ... same thing if I try to use save()
    } catch (\Exception $e) {
      return redirect()->to('/')->with('error'$e->getMessage());
    }

    return redirect()->to('/');
  

This isnt to mention the issues I had trying to use entities... (class not found?????????????)

I really want to enjoy this framework. Help me.
Reply


Messages In This Thread
Model refusing to insert data - by cantinsertdata - 01-06-2021, 10:10 PM
RE: Model refusing to insert data - by demyr - 01-08-2021, 08:28 AM
RE: Model refusing to insert data - by wdeda - 01-09-2021, 08:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB