Welcome Guest, Not a member yet? Register   Sign In
Call Procedure in CodeIgniter
#1

[eluser]super_Tai[/eluser]
I'm newbie in CodeIgniter. I used MySQL.
Can you show me the way to call procedure in CodeIginter.
I searched Google. The result was:

$query = $this->db->query("call helloworld() as A")
$query->result();
echo result->A;


but it did'nt work well.
It had an error: Unable to specified database:blog
Although in database.php file I configed as follow:

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'blog';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Note:
helloworld() is my procedure with the command: "SELECT * FROM data".

Help me! Thanks.
If you can give me an example is the best way to help me understand.


Messages In This Thread
Call Procedure in CodeIgniter - by El Forum - 06-17-2011, 01:59 AM
Call Procedure in CodeIgniter - by El Forum - 06-17-2011, 04:33 AM
Call Procedure in CodeIgniter - by El Forum - 06-17-2011, 04:56 AM
Call Procedure in CodeIgniter - by El Forum - 06-17-2011, 05:35 AM
Call Procedure in CodeIgniter - by El Forum - 06-17-2011, 05:48 AM
Call Procedure in CodeIgniter - by El Forum - 06-17-2011, 06:04 AM
Call Procedure in CodeIgniter - by El Forum - 06-17-2011, 09:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB