Codeigniter RESTful API - {“status”:false,“error”:“Unknown method.”}












5















I've managed to setup the RESTful API in my Codeigniter Application. Now I want to get some data from my MySQL database, so in my Codeigniter models folder I have created a model called category_model.php:



<?php
Class category_model extends CI_Model {
var $table_name = 'category';

function get_all_categories()
{
$this->db->select('*');
$this->db->from($this->table_name);
return $this->db->get();
}
}
?>


Then in the Codeigniter controller-folder I created a category.php file:



<?php

include(APPPATH.'libraries/REST_Controller.php');

class Category extends REST_Controller {

function __construct()
{
parent::__construct();
$this->load->model('category_model');
}

function category_get()
{
$data = $this->category_model->get_all_categories();
$this->response($data);
}

}

?>


Now, when I enter http://localhost/myproejcts/ci/index.php/category/category - I get the error {"status":false,"error":"Unknown method."} ??



what is the issue?



[UPDATE] = I get the same error when setting function index_post()










share|improve this question

























  • It's saying the method (category) cannot be found. Are you sure the server request method is get? You can check by doing $this->input->server('REQUEST_METHOD')

    – foxmulder
    Jan 13 '14 at 13:52











  • Shouldn't it be index_get() instead of category_get()? Based on github.com/philsturgeon/…

    – André Dion
    Jan 13 '14 at 13:52













  • @AndréDion index_get() doesnt work.. i get more serious errors I dont get...

    – SHT
    Jan 13 '14 at 14:13











  • @foxmulder The check doesnt give me anything... unless i checked the wrong place? I checked inside category_get() function...

    – SHT
    Jan 13 '14 at 14:14











  • Anyone? I'm running out of ideas?

    – SHT
    Jan 13 '14 at 16:40
















5















I've managed to setup the RESTful API in my Codeigniter Application. Now I want to get some data from my MySQL database, so in my Codeigniter models folder I have created a model called category_model.php:



<?php
Class category_model extends CI_Model {
var $table_name = 'category';

function get_all_categories()
{
$this->db->select('*');
$this->db->from($this->table_name);
return $this->db->get();
}
}
?>


Then in the Codeigniter controller-folder I created a category.php file:



<?php

include(APPPATH.'libraries/REST_Controller.php');

class Category extends REST_Controller {

function __construct()
{
parent::__construct();
$this->load->model('category_model');
}

function category_get()
{
$data = $this->category_model->get_all_categories();
$this->response($data);
}

}

?>


Now, when I enter http://localhost/myproejcts/ci/index.php/category/category - I get the error {"status":false,"error":"Unknown method."} ??



what is the issue?



[UPDATE] = I get the same error when setting function index_post()










share|improve this question

























  • It's saying the method (category) cannot be found. Are you sure the server request method is get? You can check by doing $this->input->server('REQUEST_METHOD')

    – foxmulder
    Jan 13 '14 at 13:52











  • Shouldn't it be index_get() instead of category_get()? Based on github.com/philsturgeon/…

    – André Dion
    Jan 13 '14 at 13:52













  • @AndréDion index_get() doesnt work.. i get more serious errors I dont get...

    – SHT
    Jan 13 '14 at 14:13











  • @foxmulder The check doesnt give me anything... unless i checked the wrong place? I checked inside category_get() function...

    – SHT
    Jan 13 '14 at 14:14











  • Anyone? I'm running out of ideas?

    – SHT
    Jan 13 '14 at 16:40














5












5








5


1






I've managed to setup the RESTful API in my Codeigniter Application. Now I want to get some data from my MySQL database, so in my Codeigniter models folder I have created a model called category_model.php:



<?php
Class category_model extends CI_Model {
var $table_name = 'category';

function get_all_categories()
{
$this->db->select('*');
$this->db->from($this->table_name);
return $this->db->get();
}
}
?>


Then in the Codeigniter controller-folder I created a category.php file:



<?php

include(APPPATH.'libraries/REST_Controller.php');

class Category extends REST_Controller {

function __construct()
{
parent::__construct();
$this->load->model('category_model');
}

function category_get()
{
$data = $this->category_model->get_all_categories();
$this->response($data);
}

}

?>


Now, when I enter http://localhost/myproejcts/ci/index.php/category/category - I get the error {"status":false,"error":"Unknown method."} ??



what is the issue?



[UPDATE] = I get the same error when setting function index_post()










share|improve this question
















I've managed to setup the RESTful API in my Codeigniter Application. Now I want to get some data from my MySQL database, so in my Codeigniter models folder I have created a model called category_model.php:



<?php
Class category_model extends CI_Model {
var $table_name = 'category';

function get_all_categories()
{
$this->db->select('*');
$this->db->from($this->table_name);
return $this->db->get();
}
}
?>


Then in the Codeigniter controller-folder I created a category.php file:



<?php

include(APPPATH.'libraries/REST_Controller.php');

class Category extends REST_Controller {

function __construct()
{
parent::__construct();
$this->load->model('category_model');
}

function category_get()
{
$data = $this->category_model->get_all_categories();
$this->response($data);
}

}

?>


Now, when I enter http://localhost/myproejcts/ci/index.php/category/category - I get the error {"status":false,"error":"Unknown method."} ??



what is the issue?



[UPDATE] = I get the same error when setting function index_post()







php mysql codeigniter rest






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 13 '14 at 14:32







SHT

















asked Jan 13 '14 at 13:44









SHTSHT

38511136




38511136













  • It's saying the method (category) cannot be found. Are you sure the server request method is get? You can check by doing $this->input->server('REQUEST_METHOD')

    – foxmulder
    Jan 13 '14 at 13:52











  • Shouldn't it be index_get() instead of category_get()? Based on github.com/philsturgeon/…

    – André Dion
    Jan 13 '14 at 13:52













  • @AndréDion index_get() doesnt work.. i get more serious errors I dont get...

    – SHT
    Jan 13 '14 at 14:13











  • @foxmulder The check doesnt give me anything... unless i checked the wrong place? I checked inside category_get() function...

    – SHT
    Jan 13 '14 at 14:14











  • Anyone? I'm running out of ideas?

    – SHT
    Jan 13 '14 at 16:40



















  • It's saying the method (category) cannot be found. Are you sure the server request method is get? You can check by doing $this->input->server('REQUEST_METHOD')

    – foxmulder
    Jan 13 '14 at 13:52











  • Shouldn't it be index_get() instead of category_get()? Based on github.com/philsturgeon/…

    – André Dion
    Jan 13 '14 at 13:52













  • @AndréDion index_get() doesnt work.. i get more serious errors I dont get...

    – SHT
    Jan 13 '14 at 14:13











  • @foxmulder The check doesnt give me anything... unless i checked the wrong place? I checked inside category_get() function...

    – SHT
    Jan 13 '14 at 14:14











  • Anyone? I'm running out of ideas?

    – SHT
    Jan 13 '14 at 16:40

















It's saying the method (category) cannot be found. Are you sure the server request method is get? You can check by doing $this->input->server('REQUEST_METHOD')

– foxmulder
Jan 13 '14 at 13:52





It's saying the method (category) cannot be found. Are you sure the server request method is get? You can check by doing $this->input->server('REQUEST_METHOD')

– foxmulder
Jan 13 '14 at 13:52













Shouldn't it be index_get() instead of category_get()? Based on github.com/philsturgeon/…

– André Dion
Jan 13 '14 at 13:52







Shouldn't it be index_get() instead of category_get()? Based on github.com/philsturgeon/…

– André Dion
Jan 13 '14 at 13:52















@AndréDion index_get() doesnt work.. i get more serious errors I dont get...

– SHT
Jan 13 '14 at 14:13





@AndréDion index_get() doesnt work.. i get more serious errors I dont get...

– SHT
Jan 13 '14 at 14:13













@foxmulder The check doesnt give me anything... unless i checked the wrong place? I checked inside category_get() function...

– SHT
Jan 13 '14 at 14:14





@foxmulder The check doesnt give me anything... unless i checked the wrong place? I checked inside category_get() function...

– SHT
Jan 13 '14 at 14:14













Anyone? I'm running out of ideas?

– SHT
Jan 13 '14 at 16:40





Anyone? I'm running out of ideas?

– SHT
Jan 13 '14 at 16:40












5 Answers
5






active

oldest

votes


















4














Depends of your HTTP request to your controller "Category" it will call related method:



public function index_get()
{
echo "GET_request";
}

public function index_post()
{
echo "POST_request";
}

public function index_put()
{
echo "PUT_request";
}

public function index_patch()
{
echo "PATCH_request";
}

public function index_delete()
{
echo "DELETE_request";
}


So, rename your method to 'index_get'






share|improve this answer































    3














    I think your problem is the name of controller is the same with the name of method try to make a test:



    if the name of your controller is:



    class Test extends CI_Controller{
    //your method name is different from the name of controller class
    public function testget_get(){
    echo $this->response(array('test'=> 'test'), 200);
    }
    }


    I have experienced this problem on hmvc structure.






    share|improve this answer
























    • so for example the name of my controller is controllername all i need to do to my functions is controllername_get controllername_post etc?

      – kev_m
      Apr 22 '16 at 4:51











    • no must be different, if your controller is called [Test] your method name should be different from your controller name excluding postfix [_get, _post].. example [name_get]. So $this->test->name_get() and not $this->test->test_get().

      – onalbi
      Apr 22 '16 at 10:12











    • okay. thankyou so much!

      – kev_m
      Apr 22 '16 at 11:11



















    1














    while calling the method don't use _get,_post ..
    say for example
    you have a method users_get



    <?php
    defined('BASEPATH') OR exit('No direct script access allowed');
    require APPPATH . '/libraries/REST_Controller.php';

    class Student extends REST_Controller {
    function __construct() {
    // Construct the parent class
    parent::__construct();
    }

    public function users_get() {
    $this->response("my first api");
    }
    }

    ?>


    let us call this method => "your base url"/student/users






    share|improve this answer


























    • Please provide a description for your answer.

      – Rohan Khude
      Aug 16 '16 at 6:25



















    0














    mention the details you want to fetch from database and enter the correct name in the database file located in /restapi/application/config/database file and run the code.



    this error occurs due to the incorrect database name



    **<?php
    Class category_model extends CI_Model {
    var $table_name = 'category';
    function get_all_categories()
    {
    $this->db->select('name, email');
    $this->db->from($this->table_name);
    return $this->db->get();
    }
    }
    ?>**





    share|improve this answer































      0














      Please change your class name to start with capital letter and make sure your file name also starts with capital letter



      <?php
      Class Category_model extends CI_Model {
      var $table_name = 'category';

      function get_all_categories()
      {
      $this->db->select('*');
      $this->db->from($this->table_name);
      return $this->db->get();
      }
      }
      ?>





      share|improve this answer























        Your Answer






        StackExchange.ifUsing("editor", function () {
        StackExchange.using("externalEditor", function () {
        StackExchange.using("snippets", function () {
        StackExchange.snippets.init();
        });
        });
        }, "code-snippets");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "1"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21092792%2fcodeigniter-restful-api-statusfalse-errorunknown-method%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        4














        Depends of your HTTP request to your controller "Category" it will call related method:



        public function index_get()
        {
        echo "GET_request";
        }

        public function index_post()
        {
        echo "POST_request";
        }

        public function index_put()
        {
        echo "PUT_request";
        }

        public function index_patch()
        {
        echo "PATCH_request";
        }

        public function index_delete()
        {
        echo "DELETE_request";
        }


        So, rename your method to 'index_get'






        share|improve this answer




























          4














          Depends of your HTTP request to your controller "Category" it will call related method:



          public function index_get()
          {
          echo "GET_request";
          }

          public function index_post()
          {
          echo "POST_request";
          }

          public function index_put()
          {
          echo "PUT_request";
          }

          public function index_patch()
          {
          echo "PATCH_request";
          }

          public function index_delete()
          {
          echo "DELETE_request";
          }


          So, rename your method to 'index_get'






          share|improve this answer


























            4












            4








            4







            Depends of your HTTP request to your controller "Category" it will call related method:



            public function index_get()
            {
            echo "GET_request";
            }

            public function index_post()
            {
            echo "POST_request";
            }

            public function index_put()
            {
            echo "PUT_request";
            }

            public function index_patch()
            {
            echo "PATCH_request";
            }

            public function index_delete()
            {
            echo "DELETE_request";
            }


            So, rename your method to 'index_get'






            share|improve this answer













            Depends of your HTTP request to your controller "Category" it will call related method:



            public function index_get()
            {
            echo "GET_request";
            }

            public function index_post()
            {
            echo "POST_request";
            }

            public function index_put()
            {
            echo "PUT_request";
            }

            public function index_patch()
            {
            echo "PATCH_request";
            }

            public function index_delete()
            {
            echo "DELETE_request";
            }


            So, rename your method to 'index_get'







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 18 '16 at 14:26









            Alex DomAlex Dom

            511




            511

























                3














                I think your problem is the name of controller is the same with the name of method try to make a test:



                if the name of your controller is:



                class Test extends CI_Controller{
                //your method name is different from the name of controller class
                public function testget_get(){
                echo $this->response(array('test'=> 'test'), 200);
                }
                }


                I have experienced this problem on hmvc structure.






                share|improve this answer
























                • so for example the name of my controller is controllername all i need to do to my functions is controllername_get controllername_post etc?

                  – kev_m
                  Apr 22 '16 at 4:51











                • no must be different, if your controller is called [Test] your method name should be different from your controller name excluding postfix [_get, _post].. example [name_get]. So $this->test->name_get() and not $this->test->test_get().

                  – onalbi
                  Apr 22 '16 at 10:12











                • okay. thankyou so much!

                  – kev_m
                  Apr 22 '16 at 11:11
















                3














                I think your problem is the name of controller is the same with the name of method try to make a test:



                if the name of your controller is:



                class Test extends CI_Controller{
                //your method name is different from the name of controller class
                public function testget_get(){
                echo $this->response(array('test'=> 'test'), 200);
                }
                }


                I have experienced this problem on hmvc structure.






                share|improve this answer
























                • so for example the name of my controller is controllername all i need to do to my functions is controllername_get controllername_post etc?

                  – kev_m
                  Apr 22 '16 at 4:51











                • no must be different, if your controller is called [Test] your method name should be different from your controller name excluding postfix [_get, _post].. example [name_get]. So $this->test->name_get() and not $this->test->test_get().

                  – onalbi
                  Apr 22 '16 at 10:12











                • okay. thankyou so much!

                  – kev_m
                  Apr 22 '16 at 11:11














                3












                3








                3







                I think your problem is the name of controller is the same with the name of method try to make a test:



                if the name of your controller is:



                class Test extends CI_Controller{
                //your method name is different from the name of controller class
                public function testget_get(){
                echo $this->response(array('test'=> 'test'), 200);
                }
                }


                I have experienced this problem on hmvc structure.






                share|improve this answer













                I think your problem is the name of controller is the same with the name of method try to make a test:



                if the name of your controller is:



                class Test extends CI_Controller{
                //your method name is different from the name of controller class
                public function testget_get(){
                echo $this->response(array('test'=> 'test'), 200);
                }
                }


                I have experienced this problem on hmvc structure.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 28 '14 at 9:09









                onalbionalbi

                1,1381730




                1,1381730













                • so for example the name of my controller is controllername all i need to do to my functions is controllername_get controllername_post etc?

                  – kev_m
                  Apr 22 '16 at 4:51











                • no must be different, if your controller is called [Test] your method name should be different from your controller name excluding postfix [_get, _post].. example [name_get]. So $this->test->name_get() and not $this->test->test_get().

                  – onalbi
                  Apr 22 '16 at 10:12











                • okay. thankyou so much!

                  – kev_m
                  Apr 22 '16 at 11:11



















                • so for example the name of my controller is controllername all i need to do to my functions is controllername_get controllername_post etc?

                  – kev_m
                  Apr 22 '16 at 4:51











                • no must be different, if your controller is called [Test] your method name should be different from your controller name excluding postfix [_get, _post].. example [name_get]. So $this->test->name_get() and not $this->test->test_get().

                  – onalbi
                  Apr 22 '16 at 10:12











                • okay. thankyou so much!

                  – kev_m
                  Apr 22 '16 at 11:11

















                so for example the name of my controller is controllername all i need to do to my functions is controllername_get controllername_post etc?

                – kev_m
                Apr 22 '16 at 4:51





                so for example the name of my controller is controllername all i need to do to my functions is controllername_get controllername_post etc?

                – kev_m
                Apr 22 '16 at 4:51













                no must be different, if your controller is called [Test] your method name should be different from your controller name excluding postfix [_get, _post].. example [name_get]. So $this->test->name_get() and not $this->test->test_get().

                – onalbi
                Apr 22 '16 at 10:12





                no must be different, if your controller is called [Test] your method name should be different from your controller name excluding postfix [_get, _post].. example [name_get]. So $this->test->name_get() and not $this->test->test_get().

                – onalbi
                Apr 22 '16 at 10:12













                okay. thankyou so much!

                – kev_m
                Apr 22 '16 at 11:11





                okay. thankyou so much!

                – kev_m
                Apr 22 '16 at 11:11











                1














                while calling the method don't use _get,_post ..
                say for example
                you have a method users_get



                <?php
                defined('BASEPATH') OR exit('No direct script access allowed');
                require APPPATH . '/libraries/REST_Controller.php';

                class Student extends REST_Controller {
                function __construct() {
                // Construct the parent class
                parent::__construct();
                }

                public function users_get() {
                $this->response("my first api");
                }
                }

                ?>


                let us call this method => "your base url"/student/users






                share|improve this answer


























                • Please provide a description for your answer.

                  – Rohan Khude
                  Aug 16 '16 at 6:25
















                1














                while calling the method don't use _get,_post ..
                say for example
                you have a method users_get



                <?php
                defined('BASEPATH') OR exit('No direct script access allowed');
                require APPPATH . '/libraries/REST_Controller.php';

                class Student extends REST_Controller {
                function __construct() {
                // Construct the parent class
                parent::__construct();
                }

                public function users_get() {
                $this->response("my first api");
                }
                }

                ?>


                let us call this method => "your base url"/student/users






                share|improve this answer


























                • Please provide a description for your answer.

                  – Rohan Khude
                  Aug 16 '16 at 6:25














                1












                1








                1







                while calling the method don't use _get,_post ..
                say for example
                you have a method users_get



                <?php
                defined('BASEPATH') OR exit('No direct script access allowed');
                require APPPATH . '/libraries/REST_Controller.php';

                class Student extends REST_Controller {
                function __construct() {
                // Construct the parent class
                parent::__construct();
                }

                public function users_get() {
                $this->response("my first api");
                }
                }

                ?>


                let us call this method => "your base url"/student/users






                share|improve this answer















                while calling the method don't use _get,_post ..
                say for example
                you have a method users_get



                <?php
                defined('BASEPATH') OR exit('No direct script access allowed');
                require APPPATH . '/libraries/REST_Controller.php';

                class Student extends REST_Controller {
                function __construct() {
                // Construct the parent class
                parent::__construct();
                }

                public function users_get() {
                $this->response("my first api");
                }
                }

                ?>


                let us call this method => "your base url"/student/users







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Aug 16 '16 at 7:27









                Martin Gottweis

                2,400825




                2,400825










                answered Aug 16 '16 at 6:22









                Virendra PawarVirendra Pawar

                111




                111













                • Please provide a description for your answer.

                  – Rohan Khude
                  Aug 16 '16 at 6:25



















                • Please provide a description for your answer.

                  – Rohan Khude
                  Aug 16 '16 at 6:25

















                Please provide a description for your answer.

                – Rohan Khude
                Aug 16 '16 at 6:25





                Please provide a description for your answer.

                – Rohan Khude
                Aug 16 '16 at 6:25











                0














                mention the details you want to fetch from database and enter the correct name in the database file located in /restapi/application/config/database file and run the code.



                this error occurs due to the incorrect database name



                **<?php
                Class category_model extends CI_Model {
                var $table_name = 'category';
                function get_all_categories()
                {
                $this->db->select('name, email');
                $this->db->from($this->table_name);
                return $this->db->get();
                }
                }
                ?>**





                share|improve this answer




























                  0














                  mention the details you want to fetch from database and enter the correct name in the database file located in /restapi/application/config/database file and run the code.



                  this error occurs due to the incorrect database name



                  **<?php
                  Class category_model extends CI_Model {
                  var $table_name = 'category';
                  function get_all_categories()
                  {
                  $this->db->select('name, email');
                  $this->db->from($this->table_name);
                  return $this->db->get();
                  }
                  }
                  ?>**





                  share|improve this answer


























                    0












                    0








                    0







                    mention the details you want to fetch from database and enter the correct name in the database file located in /restapi/application/config/database file and run the code.



                    this error occurs due to the incorrect database name



                    **<?php
                    Class category_model extends CI_Model {
                    var $table_name = 'category';
                    function get_all_categories()
                    {
                    $this->db->select('name, email');
                    $this->db->from($this->table_name);
                    return $this->db->get();
                    }
                    }
                    ?>**





                    share|improve this answer













                    mention the details you want to fetch from database and enter the correct name in the database file located in /restapi/application/config/database file and run the code.



                    this error occurs due to the incorrect database name



                    **<?php
                    Class category_model extends CI_Model {
                    var $table_name = 'category';
                    function get_all_categories()
                    {
                    $this->db->select('name, email');
                    $this->db->from($this->table_name);
                    return $this->db->get();
                    }
                    }
                    ?>**






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jan 9 '18 at 6:15







                    user9116204






























                        0














                        Please change your class name to start with capital letter and make sure your file name also starts with capital letter



                        <?php
                        Class Category_model extends CI_Model {
                        var $table_name = 'category';

                        function get_all_categories()
                        {
                        $this->db->select('*');
                        $this->db->from($this->table_name);
                        return $this->db->get();
                        }
                        }
                        ?>





                        share|improve this answer




























                          0














                          Please change your class name to start with capital letter and make sure your file name also starts with capital letter



                          <?php
                          Class Category_model extends CI_Model {
                          var $table_name = 'category';

                          function get_all_categories()
                          {
                          $this->db->select('*');
                          $this->db->from($this->table_name);
                          return $this->db->get();
                          }
                          }
                          ?>





                          share|improve this answer


























                            0












                            0








                            0







                            Please change your class name to start with capital letter and make sure your file name also starts with capital letter



                            <?php
                            Class Category_model extends CI_Model {
                            var $table_name = 'category';

                            function get_all_categories()
                            {
                            $this->db->select('*');
                            $this->db->from($this->table_name);
                            return $this->db->get();
                            }
                            }
                            ?>





                            share|improve this answer













                            Please change your class name to start with capital letter and make sure your file name also starts with capital letter



                            <?php
                            Class Category_model extends CI_Model {
                            var $table_name = 'category';

                            function get_all_categories()
                            {
                            $this->db->select('*');
                            $this->db->from($this->table_name);
                            return $this->db->get();
                            }
                            }
                            ?>






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jan 2 at 11:48









                            K Jagannath ReddyK Jagannath Reddy

                            516




                            516






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21092792%2fcodeigniter-restful-api-statusfalse-errorunknown-method%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                MongoDB - Not Authorized To Execute Command

                                How to fix TextFormField cause rebuild widget in Flutter

                                in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith