Welcome Guest, Not a member yet? Register   Sign In
Unable to connect to your database server using the provided settings.
#1

(This post was last modified: 11-28-2017, 07:53 AM by FARUKB13.)

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




Theme © iAndrew 2016 - Forum software by © MyBB