Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Stored Procedure not working

$
0
0
I have issue in call stored procedure with null value in Codeigniter 3.
I'm trying this in Model

Code:
$foo_sql = $this->db->query('call getFooData(' . $foo_id . ', "' . $fooname . '")');
$result_arr = $foo_sql->result_array();

Also I tried with
Quote:call getFooData(2152, NULL)

Code:
DELIMITER $$
CREATE DEFINER=`foodb`@`localhost` PROCEDURE `getFooData`(IN `foo_id` INT, IN `foo_name` VARCHAR(255))
BEGIN
IF foo_id!='' and foo_name!='' THEN
  SELECT
       *
   FROM
       `tblFoodata`
   WHERE `vFooName` =  foo_name AND `sc`.`iFooId` = foo_id

END IF;
END$$
DELIMITER ;

some time $fooname is null at that time CI3 return below error
Quote:Call to a member function fetch_assoc() on boolean


Please help me how to fix it.

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>