/[libdata]/trunk/include/db_connect.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/include/db_connect.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 47 by dpavlin, Fri Mar 5 13:42:57 2004 UTC revision 50 by dpavlin, Fri Mar 5 22:38:33 2004 UTC
# Line 3  Line 3 
3      /****************************************************************/      /****************************************************************/
4    
5      /* constants */      /* constants */
6      $DEBUG = 0;      $DEBUG = 0;         // XXX not used at all?
7    
8      /****************************************************************/      /****************************************************************/
9    
10          /* database parameters */          /* database parameters */
11          $db_nam = "libdata";          #$dsn = 'mysql://libdata:libdatapw@localhost/libdata';
12          $db_srv = "localhost";          $dsn = 'pgsql://dpavlin@/libdata';
13          $db_usr = "libdata";          $dsn_options = array(
14          $db_pwd = "libdatapw";                  'debug'       => 2,
15                    'portability' => DB_PORTABILITY_ALL,
16            );
17    
18      /****************************************************************/      /****************************************************************/
19    
20      /* establish a connection to the database or bailout */          /* establish a connection to the database or bailout */
21      $con = xx_connect ( $db_srv, $db_usr, $db_pwd )          $db =& DB::connect($dsn, $dsn_options);
22          or die ( "ERROR: Could not connect to database server!" );          if (DB::isError($db)) {
23      $result = xx_select_db ( $db_nam, $con )                  XXX_debug($db->getMessage() ." / ".
24          or die ( "ERROR: Could not connect to database!" );                          $db->getUserInfo() . " / ".
25                            $db->getDebugInfo());
26                    # XXX remove this!
27                    print $db->getDebugInfo();
28                    
29                    die($db->getMessage());
30            }
31    
32      /****************************************************************/      /****************************************************************/
33    

Legend:
Removed from v.47  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26