• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP: db-connection settings for ODBC to MSSQL

#3
[eluser]zyddee[/eluser]
ah, now i get it to connect..
BUT i get an error on num_rows() when i use ODBC-connection
Code:
// DB Config --------------
        $config['hostname'] = $data['adress'];
        $config['username'] = $data['username'];
        $config['password'] = $data['password'];
        $config['database'] = $data['db'];
        $config['dbdriver'] = $data['driver'];
        $config['dbprefix'] = "";
        $config['pconnect'] = FALSE;
        $config['db_debug'] = TRUE;
        $config['active_r'] = TRUE;
        // ------------------------

        if( $data['driver'] == strtolower('mssql') )
            $conn = mssql_connect($data['adress'],$data['username'],$data['password']);
        else if( $data['driver'] == strtolower('odbc') )
            $conn = odbc_connect($data['adress'],$data['username'],$data['password']);
            
        if(is_resource($conn)){
            $DB_MSSQL = $this->load->database($config, TRUE);
        }
        else {
            return 'Kunde inte ansluta till databasen';
        }
        
        $this->table = 'employee';
        $DB_MSSQL->where('a', $a);
        $DB_MSSQL->where('b', $b);
        $DB_MSSQL->select('a,b');
        $query =  $DB_MSSQL->get($this->table);
        if ( $query->num_rows() == 1 ) //<- error (Call to a member function num_rows() on a non-object in)
        {    
            $data2 = $query->row_array();
        }

Call to a member function num_rows() on a non-object in


Messages In This Thread
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-01-2008, 02:05 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-01-2008, 04:02 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-01-2008, 04:19 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-10-2008, 05:39 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-10-2008, 10:47 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-10-2008, 11:58 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 02-11-2008, 12:15 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 05-12-2008, 07:11 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 05-29-2009, 01:17 AM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 03-24-2010, 12:30 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 03-25-2010, 06:45 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 09-26-2010, 11:30 PM
HELP: db-connection settings for ODBC to MSSQL - by El Forum - 03-08-2012, 03:52 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.