Re: Connection File

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I am wondering is it possible to use a connection file that contains
> the information needed for php pages to connect to a DB, instead of
> writing the connection info into the code itself?
>

Way 1:
 require_once('connect.to.db.php');
 // and put on this file the connection info an code.

Way 2:
  $fc = fopen('configuration.txt', 'r');
  list($host, $user, $pass, $dbname) = fgetcsv($fc, 80);
  fclose($fc);
  // the file only has connection info, then you can write code...

and, of course, Way1+2: You have a .php conection file, with all code, and
a .txt conection info file, then in .php you read .txt file and put
conection code.

-- 
José Miguel Santibáñez
    jms@xxxxxxxxx


PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux