Codeigniter Error Number 1312
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us error number 1054 in codeigniter Learn more about Stack Overflow the company Business Learn more about hiring developers
Error Number 1146 In Codeigniter
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow error number 1064 codeigniter Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up can't return a result table using procedure with
Error Number 1048 Codeigniter
CI up vote 0 down vote favorite this is the first time I'm using procedure in mysql and I'm not good enough with CI, I want to make procedure to show content of my table, and here's my procedure; CREATE DEFINER=`root`@`%` PROCEDURE `TestNewProcedure`() BEGIN select * from app_tablet; END; when I tried run with mysql it works fine, but I want to call it call it from error number 1062 codeigniter my model with CI I got an error, here's my code for controller; public function tes3(){ $data['rows'] = $this->menu_model->selectQuery("call TestNewProcedure()"); $this->load->view('xml_view',$data); } and here's the code from model function selectQuery($query){ return $this->db->query($query)->result(); } and this is error message that I got; Error Number: 1312 PROCEDURE myDB.TestNewProcedure can't return a result set in the given context call TestNewProcedure() Filename: /var/www/newfolder/models/menu_model.php Line Number: 13 I want to show content of my table using procedure, how can I do that? mysql codeigniter stored-procedures share|improve this question edited Sep 13 '13 at 5:09 asked Sep 13 '13 at 4:54 student080705639 4641126 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote $query = $this->db->query("call TestNewProcedure()"); return $query->result(); share|improve this answer answered Sep 13 '13 at 5:25 shemeermali 389520 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged mysql codeigniter stored-procedures or ask yo
of our content. View the full version with proper formatting. El Forum07-13-2009, 06:31 AM [eluser]bhakti.thakkar[/eluser] Hi all, i have created a
Codeigniter Error 500
SP and created successfully (MYSQL 5.0.45) now i want to
Codeigniter Error 404 Page Not Found
execute that SP in CI. i read somewhere in this forum that you have to codeigniter error message use mysqli instead of mysql driver and for that i even changed the line in database.php as below: Code: function db_connect()
{
define("CLIENT_MULTI_RESULTS",131072);//Enable/disable http://stackoverflow.com/questions/18778569/cant-return-a-result-table-using-procedure-with-ci multi-results
define("CLIENT_MULTI_STATEMENTS",65536);//Enable/disable multi-statement support
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE,CLIENT_MULTI_STATEMENTS);
} and also have changed the database setting to this: $db['default']['pconnect'] = FALSE; and run the script: $sql=" call colavg('Task_T' , 'EstimatedHours_DC')"; $rs= $this->db->query($sql); //print $rs; and i still get the error : Code: A Database Error http://forum.codeigniter.com/archive/index.php?thread-20520.html Occurred
Error Number: 1312
PROCEDURE mydb.colavg can't return a result set in the given context
call colavg('Task_T' , 'EstimatedHours_DC') please help El Forum03-15-2010, 10:40 PM [eluser]jaRguS[/eluser] i have the same question. Please help El Forum03-16-2010, 03:20 AM [eluser]bgreene[/eluser] $sql=”select colavg(‘Task_T’ , ‘EstimatedHours_DC’)”; $rs= $this->db->query($sql); El Forum08-26-2010, 08:49 PM [eluser]jipod[/eluser] I also have some problem ... hiks.. but a sample stored procedure i tried call and can get results, this code like this : Code: class Sp extends Model {
function __construct()
{
parent::Model();
}
function sp_jual_in()
{
//post data
$vnojual = "001";
$vtgljual = "2010-08-01";
$voutlet = "out001";
$vkdrokok = "02";
$vbal = 1;$vpres = 2;$vbks = 3;
$query = " CALL sp_jual_in(?, ?, ?, ?, ?, ?, ?)
procedur: A Database Error Occurred
Error Number: 2014
Commands out of sync; you can't run this command now Rozwizaniem jest http://users.pja.edu.pl/~piotrf/techniczny/?tag=codeigniter podmienienie funkcji function _execute($sql) w /system/databases/drivers/mysqli/mysqli_driver.php na: function _execute($sql)
http://dba.stackexchange.com/questions/33986/cant-return-a-result-set-in-the-given-context-error-when-calling-stored-proce {
// Free result from previous query
@mysqli_free_result($this->result_id);
$sql = $this->_prep_query($sql);
// get a result code of query (), can be used for test is the query ok
$retval = @mysqli_multi_query($this->conn_id, $sql);
// get error number a first resultset
$firstResult = @mysqli_store_result($this->conn_id);
// free other resultsets
while (@mysqli_next_result($this->conn_id)) {
$result = @mysqli_store_result($this->conn_id);
@mysqli_free_result($result);
}
// test is the error occur or not
if (!$firstResult && !@mysqli_errno($this->conn_id)) {
return true;
}
return $firstResult;
}
codeigniter error number Jan 13, 2009 0 CodeIgniter i procedury składowane w MySQL Używając CodeIgnitera z procedurami z MySLQ 5 napotkałem się na błąd: A Database Error Occurred
Error Number: 1312
PROCEDURE usr_uzytkownik_sel_check_login can't return a result set in the given context
CALL usr_uzytkownik_sel_check_login(); Obejściem togo jest zmiana w /System/database/drivers/mysql/mysql_driver.php funkcji db_connect() na function db_connect() {
define("CLIENT_MULTI_RESULTS",131072);//Enable/disable multi-results
define("CLIENT_MULTI_STATEMENTS",65536);//Enable/disable multi-statement support
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE,CLIENT_MULTI_STATEMENTS);
} i ustawienie w configu database.php $db['default']['pconnect'] = FALSE; Teraz już możemy odwoływać się do naszej procedury z modelu $sql = 'call usr_uzytkownik_sel_check_login(?)';
$param = array($login);
return $query = $this->db->query($sql, $param); Calendar October 2016 M T W T F S S « Oct 12 3456789 10111213141516 17181920212223 24252627282930 31 TagsCodeIgniter MySQL PHP procedury Archives October 2009 January 2009 FrontpageReturn home BrowseBy topic SubscribeRSS feed Programowanie Uncategorized Grid Focus by Derek Punsalan 5thirtyone.com. Whitespace
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top “can't return a result set in the given context” error when calling stored procedure - differences between mysql 5.0 and 5.5? up vote 1 down vote favorite 1 I have a stored procedure to regenerate leafs (nleft, nright) in simple (id, id_parent) tree. (sample table) When I'am calling CALL EdgeListToNestedSet( 'category', 'id_category', 'id_parent'); it works great with version 5.5.29 of mysql but on 5.0.26 I've got an error: #1312 - PROCEDURE test.EdgeListToNestedSet can't return a result set in the given context Any ideas what can be wrong and how to make it working? mysql stored-procedures share|improve this question asked Feb 1 '13 at 17:56 ts. 12216 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted Older versions of phpMyAdmin have issues with MySQL. This has been asked 8 times in StackOverflow with the tag mysql-error-1312. This bug was seen and addressed in MySQL 5.0.09 beta about 6 weeks after MySQL 5.0.26 was released Oct 09, 2006. Still, you got this error. According to http://qasimbadami.wordpress.com/tag/mysql-error-1312/, you should make sure you are using mysqli / PDO. share|improve this answer answered Feb 1 '13 at 22:43 RolandoMySQLDBA 107k15138274 add a comment| up vote 0 down vote I had this problem too; calling the procedure worked on my local xampp instalation but not on the live server. Tried a lot of things and pulled a lot of hair on this one. I was concatenating some strings in the procedure, on different rows for clarity; after i put all the text of the concat statement on