php - PEAR MDB2 executeStoredProc and returning a result set. Possible? Worth it? -
I am trying to do this for the past two hours. I have a simple stored proc named get_log_entries:
builder = 'root' @ local location process' get_log_entries` (p_min_id INT) BEGIN SET p_min_id = IFNULL (p_min_id, -1) ); SELECT * FROM db_log WHERE item_id & gt; P_min_id; END This dead is simple and gives results in two columns: item_id (int) and log_description (varchar).
I am trying to execute it using the MDB2 object, but there is no luck yet. This is the code that is trying to do this:
< Code> $ conn = MDB2 :: factory ('mysql: // myUser: myPassword @ localhost / my_db'); If (PAR :: ether ($ Conn) (dies ("DB (10) can not be included:". $ Conn-> getMessage ());} // Function module loading $ conn- & Load parameters ('function'); $ Params = array ('null'); $ result = $ conn- & gt; Strike proof executed ('get_log_entries', $ params); if (PAR :: ether ($ result) ) {$ Msg = $ Results-> Messages received (")"
GetUserInfo (); die ($ msg) ;} At this point it appears with a good error message:
"_ doQuery: [error message: statement Can not be executed] [last executed query: call get_log_entries ()] [native code: 1312] [original message: PROCEDURE WH_SEARCH.get_log_entries can not return result set in given reference] "
Now I have a question:
1. Is it possible to execute SP using MDB 2 and return result sets?
2. Or cover class for "basic" PHP-MySQL functions Is it better to write?
No problem, SS To call mysqli wrapping area. Plus a lot of fun ...
Comments
Post a Comment