• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic DSN issue

Hello again, Im having a strange issue with my dynamic DSN that im using here. Basicly i call from the main Database thats setup in the config.php to retrieve the DSN to another SQL Server to use for the actual output of the page. everything seems to be working but i don't know if something is escaping wrong, or if I'm just blind. The result of the following code results in this error in the logs
Quote:Severity: Warning --> mssql_select_db() : message: Could not locate entry in sysdatabases for database 'QL1'. No entry found with that name. Make sure that the name is entered correctly. (severity 16) C:\...\mssql_driver.php 75
Severity: Warning --> mssql_select_db() : Unable to select database: QL1\SQLEXPRESS C:\...\mssql_driver.php 75
Unable to select database: QL1\SQLEXPRESS
Severity: Warning --> mssql_query() : message: Invalid object name 'user_data'. (severity 16) C:\...\mssql_driver.php 106
Severity: Warning --> mssql_query() : Query failed C:\...\mssql_driver.php 106

the problem i see is 2.
1) its looking for the DB QL1, that should be the server name (well SQL1)
2) It cut off the S from SQL1 (the server name).

now the DSN stored in the DB is mssql://user:[email protected]\SQLEXPRESS/lin2worldCT1

user:pass are just masks, they are right in the DB.

Any ideas on why its doing this?

here is the code that does all the magic

function index()
        $dsn = $this->db->get_where("admin_servers", array("id" => $this->session->userdata("server")));
        if ($dsn->num_rows() > 0)
            $row = $dsn->row();
            $server = $this->load->database($row->db_dsn, TRUE);
        $server->select("char_name, char_id, account_id, class, lev, gender, race, use_time");
        $server->where("login >", "logout");
        $server->order_by("use_time", "desc");
        $data['query']      = $server->get("user_data");
        $data['player_count'] = $server->count_all_results()-1;
        $this->load->view('character/CharOnline_view', $data);

Thanks in advance.

This is starting to look like a bug, just for kicks. i hard coded the DSN and i get the same errors

$server = $this->load->database("mssql://user:[email protected]\SQLEXPRESS/lin2worldCT1", TRUE);

still trying to connect to the DB QL1

All is good, seems to have been the bug posted here


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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