Welcome Guest, Not a member yet? Register   Sign In
execute mysql stored procedures with CodeIgniter
#4

[eluser]xwero[/eluser]
You have to use the mysqli driver but there are no functions added to call stored procedures so you have to add them yourself or use the call_function method. If would be something like this
Code:
$stmt = $this->db->call_function('stmt_init',$this->db->conn_id;);
if ($this->db->call_function('stmt_prepare',$stmt, 'SELECT District FROM City WHERE Name=?')) {

    /* bind parameters for markers */
    $this->db->call_function('stmt_bind_param',$stmt, "s", $city);

    /* execute query */
    $this->db->call_function('stmt_execute',$stmt);

    /* bind result variables */
    $this->db->call_function('stmt_bind_result',$stmt, $district);

    /* fetch value */
    $this->db->call_function('stmt_fetch',$stmt);

    printf("%s is in district %s\n", $city, $district);

    /* close statement */
    $this->db->call_function('stmt_close',$stmt);
}
I took the example from php.net because i never used it but at least you get the idea how it can be done.


Messages In This Thread
execute mysql stored procedures with CodeIgniter - by El Forum - 02-08-2008, 01:23 PM
execute mysql stored procedures with CodeIgniter - by El Forum - 02-09-2008, 11:06 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 02-26-2008, 04:50 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 02-26-2008, 05:23 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 02-26-2008, 03:25 PM
execute mysql stored procedures with CodeIgniter - by El Forum - 04-16-2008, 03:48 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 04-16-2008, 07:45 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 04-22-2008, 04:00 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 04-22-2008, 10:47 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 08-06-2008, 07:50 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 10-16-2008, 03:17 PM
execute mysql stored procedures with CodeIgniter - by El Forum - 02-25-2009, 06:58 PM
execute mysql stored procedures with CodeIgniter - by El Forum - 11-05-2009, 01:05 PM
execute mysql stored procedures with CodeIgniter - by El Forum - 12-17-2009, 01:18 PM
execute mysql stored procedures with CodeIgniter - by El Forum - 02-21-2010, 01:26 PM
execute mysql stored procedures with CodeIgniter - by El Forum - 02-28-2010, 04:18 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 04-21-2010, 01:25 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 08-22-2010, 04:15 AM
execute mysql stored procedures with CodeIgniter - by El Forum - 01-23-2011, 05:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB