• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to connect to your database server using the provided settings.

#1
PHP Code:
public function verversCampagne(){

 
 
        $config
['hostname'] = 'secret';
 
       $config['username'] = 'secret';
 
       $config['password'] = 'secret';
 
       $config['database'] = 'dbname';
 
       $config['dbdriver'] = 'sqlsrv';
 
       $config['dbprefix'] = '';
 
       $config['pconnect'] = TRUE;
 
       $config['db_debug'] = TRUE;
 
       $config['cache_on'] = FALSE;
 
       $config['cachedir'] = '';
 
       $config['char_set'] = 'utf8';
 
       $config['dbcollat'] = 'utf8_general_ci';

 
       $this->db $this->load->database($configtrue);

 
       $search $this->input->post('campagne');

 
       $dropdown_data['search'] = $search;

 
       $query $this->db->query("SELECT Campagne FROM project WHERE campagne in ('$search')");

 
       $databasenaam $query->row();

 
       if($query->num_rows() > 0)
 
       {
 
           return $databasenaam->Campagne;
 
       } else {
 
           return $databasenaam;
 
       
 
   
Unable to connect to your database server using the provided settings.

What did I do wrong?
Reply

#2
stackoverflow:

Codeigniter 3 not connecting to sqlserver database
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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