ok actually 3 ways to do it.
In my opinion the best would be phplib.
All login data are stored parallel to the webroot.
Inside the pages you can do something like:
$db = new DB_database;
$db->query("SELECT * from Bla");
while ($db->next_record()) {
print $db->f("Name");
}
and the field value of Name from the Table bla will be displayed.
Alternatively you can use:
ADODB is a database wrapper library for PHP. Works with heaps of databases including MySQL, MSSQL, Access, Oracle, PostgreSQL, Interbase, VFP, Sybase, ODBC etc.
Have not worked with it, but it sounds pretty neat. And is an option if you cannot install phplib on the server.
3rd option would be to move the connect with the data to an include folder which you protect via htaccess. So no one can get the info. Probably true for ADODB too, not sure.
So when you open a page you just
require ("/data/login.inc");
and then go ahead to make your queries.
enjoy.