1 Replies - 1249 Views - Last Post: 04 December 2012 - 03:25 AM

#1 vbnewbeginer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 25-July 12

Unable to connect Database using provided settings

Posted 04 December 2012 - 02:02 AM

I got error when running my website
Attached Image

i am using xampp (phpmyAdmin) and php version 5.3.8
hope fot your help guys! Thanks!

this is my settings in the DB_driver.php
Attached File  DB_driver.php (31.51K)
Number of downloads: 3

class CI_DB_driver {

	var $username;
	var $password;
	var $hostname;
	var $database;
	var $dbdriver		= 'mysql';
	var $dbprefix		= '';
	var $char_set		= 'utf8';
	var $dbcollat		= 'utf8_general_ci';
	var $autoinit		= TRUE; // Whether to automatically initialize the DB
	var $swap_pre		= '';
	var $port			= '';
	var $pconnect		= FALSE;
	var $conn_id		= FALSE;
	var $result_id		= FALSE;
	var $db_debug		= FALSE;
	var $benchmark		= 0;
	var $query_count	= 0;
	var $bind_marker	= '?';
	var $save_queries	= TRUE;
	var $queries		= array();
	var $query_times	= array();
	var $data_cache		= array();
	var $trans_enabled	= TRUE;
	var $trans_strict	= TRUE;
	var $_trans_depth	= 0;
	var $_trans_status	= TRUE; // Used with transactions to determine if a rollback should occur
	var $cache_on		= FALSE;
	var $cachedir		= '';
	var $cache_autodel	= FALSE;
	var $CACHE; // The cache class object

	// Private variables
	var $_protect_identifiers	= TRUE;
	var $_reserved_identifiers	= array('*'); // Identifiers that should NOT be escaped

	// These are use with Oracle
	var $stmt_id;
	var $curs_id;
	var $limit_used;

This post has been edited by Atli: 04 December 2012 - 03:21 AM
Reason for edit:: Use [code] tags when posting code.


Is This A Good Question/Topic? 0
  • +

Replies To: Unable to connect Database using provided settings

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: Unable to connect Database using provided settings

Posted 04 December 2012 - 03:25 AM

I'm guessing you need to fill in the first four member variables in that class with valid values. Otherwise it's just NULL, which will obviously not work. If this is using a standard XAMPP setup, you should use "localhost" for the hostname, and you can try just using "root" for the username (during development only!) and an empty password. The database you'll have to create yourself and fill in the variable with the database name you chose.

Also, that PHP code is WAY outdated. That's the syntax that was used with PHP 4. If you are still using PHP 4, you really really need to upgrade.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1