I do not know if this is a mysql ? or a php? or a hosting? BUT!
I am encountering errors when trying to figure out how to add my credentials for my database...
Please help me edit whet ever i need to edit to get this going...
The goal is to access the CMS and start editing my website.
The following is code from godaddy for my database...
Code:
<?php
//Variables for connecting to your database.
//These variable values come from your hosting account.
$hostname = "blahblahblahDB.com";
$username = "blahblah";
$dbname = "blah";
//These variable values need to be changed by you before deploying
$password = "your password";
$usertable = "your_tablename";
$yourfield = "your_field";
//Connecting to your database
mysql_connect($hostname, $username, $password) OR DIE ("Unable to
connect to database! Please try again later.");
mysql_select_db($dbname);
//Fetching from your database table.
$query = "SELECT * FROM $usertable";
$result = mysql_query($query);
if ($result) {
while($row = mysql_fetch_array($result)) {
$name = $row["$yourfield"];
echo "Name: $name<br>";
}
TURNKEY-Website-ERROR-Logs
.....
Fresh after decompressing into html root directory...
#1 ERROR:
.....
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 242
.....
After editing code to include dbname, and such info @ the line of error, or anywhere really...
#2 ERROR
.....
Fatal error: Call to undefined method CI_Loader::_ci_autoloader() in /home/content/15/10364715/html/CMS/system/core/Controller.php on line 53
.....
The Following is the code that is under ? From /CMS/system//core/loader.php
Code:
// --------------------------------------------------------------------
/**
* Database Loader
*
* @access public
* @param string the DB credentials
* @param bool whether to return the DB object
* @param bool whether to enable active record (this allows us to override the config setting)
* @return object
*/
function database($params = '', $return = FALSE, $active_record = NULL)
{
// Grab the super object
$CI =& get_instance();
// Do we even need to load the database class?
if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db))
{
return FALSE;
}
require_once(BASEPATH.'database/DB'.EXT);
if ($return === TRUE)
{
return DB($params, $active_record);
}
// Initialize the db variable. Needed to prevent
// reference errors with some configurations
$CI->db = '';
// Load the DB class
$CI->db =& DB($params, $active_record);
}
// --------------------------------------------------------------------
The following is the code in regards to the 2nd error i get:
Code:
public function __construct()
{
self::$instance =& $this;
// Assign all the class objects that were instantiated by the
// bootstrap file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
foreach (is_loaded() as $var => $class)
{
$this->$var =& load_class($class);
}
$this->load =& load_class('Loader', 'core');
$this->load->_base_classes =& is_loaded();
$this->load->_ci_autoloader();
log_message('debug', "Controller Class Initialized");
}