My apologies for being a slightly broader question then most like but i can’t find any help throughout the internet for this. I’m working on a site where i am not in charge of the database (yes its very problematic) and i was told to use a stored procedure to insert data into a table.
The query is being run. It inserts the data into the table but something else is triggering the error.
My question is: Is there anything in this code that would trigger that error or is it something in the stored procedure? What can i do to test for it? Any suggestions at all? I can’t figure out what the error number : 0 actually is.
I’m using codeigniter framework. Here’s the code:
public function addScopeContent () {
$cn = '%';
$gp = $this->input->post('group');
$co = $this->input->post('company');
$ci = $this->input->post('city');
$dp = '%';
if ($gp == 'BU000') {
$gp = '%';
}
if ($co == 'CO000') {
$co = '%';
}
if ($ci == 'CI000') {
$ci = '%';
}
$location = $cn .'-'. $gp .'-'. $co .'-'. $ci .'-'. $dp;
$query = $this->db->query('call rollout_systems_multiimport('. $this->session->userdata('scopeId') .', "'. $location .'")');
if ($query) {
redirect('discovery/addContent');
}
}
This is the stored procedure:
CREATE DEFINER=`root`@`localhost` PROCEDURE `rollout_systems_multiimport`(
var_scope_id varchar(250),
var_searchString varchar(250))
BEGIN
Insert into rollout_systems
(`sys_name`, `sys_serial`, `eam_model`, `EOL_date`, `eam_user`, `scope_id`)
select `ad_name`,`eam_Serial_Number`,`eam_Model`,`Model_EOL`,`ad_account`,var_scope_id
from `disc_userpool` inner join `disc_systempool`
on `ad_account` = `user_aurora_id`
Where `disc_userpool`.`location_code` like var_searchString;
NOTE: I just tried changing the dbdriver in the database.php page from mysqli to mysql. It doesnt give an error anymore.
It seems to be a codeigniter mysql driver bug, try using the
simple_querymethod.