Welcome Guest, Not a member yet? Register   Sign In
how to cal store procedure in codeginter 2.x
#1

[eluser]teddy[/eluser]
I read some topics and confuse way to call mysql store procedure, I don't know where is my wrong if I did like below

1. change to $db['default']['dbdriver'] = 'mysqli';
2. $db['default']['pconnect'] = TRUE; ???? exactly set is FALSE or TRUE, current I set FALSE

after make it all I get error when call a second store procedure, first store procedure is ok

Fatal error: Call to a member function result() on a non-object in ....


Model

Code:
return $this->db->query('call get_loai_deal()')->result();


Other question I want, can I get result_array when call $this->db->query('call store procedure')->result_array()
#2

[eluser]teddy[/eluser]
I found this link : http://ellislab.com/forums/viewthread/71141/ and it working for me, but after call store procedure I must add the code:
clean_mysqli_connection($this->db->conn_id);

how can avoid add above line code, because it make more messy in my model


#3

[eluser]teddy[/eluser]
until now I can't call to store procedure event after read the topic http://ellislab.com/forums/viewthread/71141/ it run only localhost and not working in hosting, someone help me pls, exactly CI 2.x can support call store procedure, pls tell me the some line doc of Essliblab publish about call store procedure, I lost a lot of time for this problem.

I hadn't meet any problems when used store procedure in SQL Server and C# and I don't know why was too hard to call a store procedure in codeigniter, I think Essliblab should be made a tutorial about this

Thk for reading my topic




Theme © iAndrew 2016 - Forum software by © MyBB