Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

php - Multiple queries in stored procedure not working in codeigniter

Need to fetch all rows from 3 tables where current status =1

$query =  $this->db->query("CALL GetALLDetails('1')");
$result = $query->result_array();
print_r($result);

Stored Procedure:-

BEGIN
 select * from table1 where current_status = status;
 select * from table2 where current_status = status;
 select * from table3 where current_status = status;
END

Am getting result of first query statement only.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER SQL QUERY...');
$this->db->query('AND YET ANOTHER SQL  QUERY...');
$this->db->trans_complete(); 

Note:- For more about transactions


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...