Welcome Guest, Not a member yet? Register   Sign In
Connecting to the database problem
#1

[eluser]Thomas Edwards[/eluser]
Having an issue with connecting to a database, usual message:

"Unable to connect to your database server using the provided settings."

If I use a standard script, like so, it connects fine and gets data.
Code:
<?php

DEFINE (DB_USER, "username");
DEFINE (DB_PASSWORD, "password");
DEFINE (DB_HOST, "localhost");
DEFINE (DB_NAME, "database");

$db_connection = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD);

mysql_select_db (DB_NAME);

$query = "SELECT * FROM stories";
$result = mysql_db_query (DB_NAME, $query, $db_connection);
while ($row = mysql_fetch_array($result)) {
    echo 'entry';
}

?>

However, pop the same working settings into CI and it always returns that error. Any ideas?


Messages In This Thread
Connecting to the database problem - by El Forum - 07-25-2010, 02:33 PM
Connecting to the database problem - by El Forum - 07-25-2010, 02:44 PM
Connecting to the database problem - by El Forum - 07-25-2010, 02:46 PM
Connecting to the database problem - by El Forum - 07-25-2010, 03:57 PM
Connecting to the database problem - by El Forum - 07-25-2010, 06:08 PM
Connecting to the database problem - by El Forum - 07-26-2010, 01:56 AM
Connecting to the database problem - by El Forum - 07-26-2010, 02:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB