Created
June 6, 2012 18:20
-
-
Save ckdarby/2883718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DEFINER=`user`@`localhost` PROCEDURE `test`() | |
BEGIN | |
SELECT * FROM users; | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* application/models/testmodel.php | |
* | |
*/ | |
class Testmodel extends CI_Model { | |
public function __construct(){ | |
parent::__construct(); | |
} | |
public function test(){ | |
$query = $this->db->query("CALL test"); | |
return $query->result(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* application/controllers/welcome.php | |
* | |
*/ | |
class Welcome extends CI_Controller { | |
public function index() | |
{ | |
$this->load->model('Testmodel'); | |
$this->Testmodel->test(); | |
$this->load->view('welcome_message'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment