/[PAMELA software]/utilities/downlinktable/src/ins/connect.inc.php
ViewVC logotype

Annotation of /utilities/downlinktable/src/ins/connect.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Apr 4 16:02:32 2007 UTC (17 years, 8 months ago) by cafagna
Branch: MAIN
CVS Tags: v1r1, v1r2, HEAD
PHP include file and header and footer files

1 cafagna 1.1 <?
2     //****************************************************************************
3     //
4     // file connect.inc.php
5     //
6     // Da includere ogni volta ci si voglia connettere al database.
7     //
8     // Contiene:
9     // 1. funzioni di utilità per le queries
10     // 2. costanti di configurazione per la connessione, nomi delle tabelle
11     // 3. chiamate di connessione al database
12     //
13     // Last Revision: 10.09.2001
14     //
15     //****************************************************************************
16    
17     //
18     // *** queries
19     //
20    
21     //******************************************
22     //*** Funzioni di utilità per le queries ***
23     //******************************************
24    
25     Function MyQueryError( $q ) {
26     Echo "<br><br><h1>*** ERROR ***</h1>";
27     Echo "Query: <b><pre>".$q."</pre></b><br>";
28     Echo "MySql_Error: <b><pre>".MySql_Error()."</pre></b><br>";
29     Exit();
30     }
31    
32     Function MyQuery( $q ) {
33     $res = MySql_Query( $q );
34     If ( ! $res ) {
35     MyQueryError( $q );
36     }
37     Return $res;
38     }
39    
40     //************************
41     //*** DB Configuration ***
42     //************************
43    
44     $mysql_port = "3306";
45    
46     /*$realPath = RealPath( "./" );*/
47    
48     $mysql_host = "localhost";
49     $mysql_login = "buttaro";
50     $mysql_password = "gr249fk";
51     $mysql_database = "qlook";
52    
53     If ( $mysql_port != 3306 ) { $mysql_host = "$mysql_host:$mysql_port";}
54    
55     //******************
56     //*** Connection ***
57     //******************
58    
59     $c = MySql_Connect ( $mysql_host, $mysql_login, $mysql_password );
60     If ( ! $c ) {
61     Echo "Error connecting to database!<P>";
62     Exit;
63     }
64    
65     If ( ! MySql_Select_DB ( $mysql_database ) ) {
66     Echo "Error selecting database \"$mysql_database\"!<P>";
67     Echo "MySQL error is: ".MySql_Error();
68     Exit;
69     }
70    
71     //*******************************
72     //******* END OF FILE *******
73     //*******************************
74     ?>

  ViewVC Help
Powered by ViewVC 1.1.23