Welcome Guest, Not a member yet? Register   Sign In
ci newbie - problem with stored procedure in MS SQL Server 2000
#1

[eluser]kun kun[/eluser]
i have model that access mssql server 2000 with stored procedure, but i have error like this :

____________________________________________
A Database Error Occurred

Error Number:

The statement has been terminated.

Exec S_REKAP_PEMINATAN_1 2006,4
_____________________________________________

this is the controller
Code:
<?php

class CRekapBeliFormulir extends Controller {
    
    function __construct(){
        parent::Controller();
        $this->is_logged_in();
    }    
    
    function index ()
    {
        $this->load->model('mRekapBeliFormulir');
        $data['vRekapBeliFormulir']=$this->mRekapBeliFormulir->get_all();
        $this->load->view('vRekapBeliFormulir', $data);
    }        
    
    function is_logged_in()
    {
        $is_logged_in = $this->session->userdata('is_logged_in');
        
        if (!isset($is_logged_in) || $is_logged_in != true )
        {
            $this->load->view('members_false');
        }
    }    

}


this is the model
Code:
<?php

class MRekapBeliFormulir extends Model {
    
    function mRekapBeliFormulir(){
        parent::Model();
    }        
    
    function get_all(){
        $data = array();
        
        $kueri = $this->db->query('Exec S_REKAP_PEMINATAN_1 2006,4');
        if ($kueri->num_rows() > 0){
            foreach ($kueri->result_array() as $row){
                $data[] = $row;
            }
        }
        
        $kueri->free_result();
        return $data;
        
    }
}


this is the view
Code:
<?php

echo '<ol>';

if ($vRekapBeliFormulir){
    foreach ($vRekapBeliFormulir as $row){
        echo $row['NamaProgdis'];
        echo $row['JumlahBeliForms'];
        echo '<br>';
    }
    echo '</ol>';
}
else{
    echo '<h2>Sorry...:p</h2>';
}

anyone can solve this ? thanks ^_^
#2

[eluser]danmontgomery[/eluser]
in config/database.php, check persistent connections are enabled:

Code:
$db['default']['pconnect'] = TRUE;
#3

[eluser]kun kun[/eluser]
thanks for your attention ^_^, i'm sorry if my english so bad

this is my config/database.php

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "192.168.0.2";
$db['default']['username'] = "username";
$db['default']['password'] = "password";
$db['default']['database'] = "DATABASE";
$db['default']['dbdriver'] = "mssql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
#4

[eluser]Unknown[/eluser]
i think i need this too... does anyone can solve this ?
#5

[eluser]titandj[/eluser]
Hi!

If your english is bad, do you speak spanish?

to me the same error happened, the problem was that a query did not run properly and so threw this error.

If you're doing an insert into a table check that you are passing all the required fields because it will not let you run the following queries. make sure the fields that are not happening are not marked as not-null.




Theme © iAndrew 2016 - Forum software by © MyBB