Ошибки в codeigniter - PullRequest
0 голосов
/ 23 мая 2018

ЭТИ ОШИБКИ

Warning:
include(C:\xampp\htdocs\test\application\views\errors\html\error_php.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\test\system\core\Exceptions.php on line 268

Warning: include(): Failed opening
'C:\xampp\htdocs\test\application\views\errors\html\error_php.php' for
inclusion (include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\test\system\core\Exceptions.php on line 268

Warning:
include(C:\xampp\htdocs\test\application\views\errors\html\error_php.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\test\system\core\Exceptions.php on line 268

Warning: include(): Failed opening
'C:\xampp\htdocs\test\application\views\errors\html\error_php.php' for
inclusion (include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\test\system\core\Exceptions.php on line 268

Контроллер это ->

<?php 

defined('BASEPATH') OR exit('No direct script access allowed');
#require APPPATH . '/libraries/REST_Controller.php';
class Getdetails extends CI_Controller #REST_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->model('Getusermodel');
        $this->load->helper('Utility_helper');
    }
    // insert user data from the api 
    public function insert_user_details()
    {
        //curl call for getting user details
        $url_user = "https://jsonplaceholder.typicode.com/users";
        $user_array = curlblock($url_user);
        //print_r($user_array);
        $userw_array=array();
        foreach ($user_array as $key => $value) 
        {

            if($key <= 4)
            {
                $usrpld=array("id" => $value['id'] ,
                                "name" => $value['name'],
                                "username" => $value['username'],
                                "email" => $value['email'],
                                "phone" => $value['phone'],
                                );
                array_push($userw_array,$usrpld);
            }

        }
        print_r($userw_array);
    }

}

Модель это->

<?php 

/**
* 
*/
class Getusermodel extends CI_Model
{

    public function __construct()
    {
        parent::__construct();
        $this->load->database();
    }

    public function insert_user(array $payload)
    {
        {


        $this->db->where('id',$payload['id']);
        $query=$this->db->get('userdetails');
        $result=$query->result();

        }
        $num_rows=$query->num_rows();

        if($num_rows <=1)
        {
            //insert
            $this->db->insert('userdetails',$payload);
        }
        else
        {
            //update
            $this->db->where('id', $payload["id"]);
            $this->db->update("userdetails", array('usrpld' => $payload["userdetails"]));
        }

    }

}

1 Ответ

0 голосов
/ 24 мая 2018

Пожалуйста, проверьте файл error_php.php.Если он существует и имеет соответствующие разрешения.

...