|
PCCS MySQLDatabase Admin Tool version 1.3.4
|
/incs/ -> dbconnect.php
1 <?php
2 /////////////////////////////////////////////////////////////////////// 3 // Coder: cthorn 4 // Filename: dbconnect.php 5 // Function - Provide variables for database interaction 6 // 7 // updated 10-07-2000 8 // -- added comments and started file changelog 9 // -- there may not be anymore modifications to this file 10 // 11 // Define database parms 12 // The userid and password info is in the 13 // dbuserpasswd.php 14
15
16 include('/home/www/htdocs/pccsmysqladm/incs/dbuserpasswd.php');
17
18
19 // This variable adds support for the 3.23.xx series of MySQL 20 // It also allow windows configs to work 21 // yes if 3.23.xx series or windows mysql 22 // default is set to no 23 // Not using 3.23.xx or windows 24
25 // Make connection and define the number of rows to display 26
27 $f = mysql_connect("$db_server","$db_user","$db_passwd") or die(mysql_error());
28
29 // Updated 10-22-2000 30 // Getting variable info for $_isbeta 31 // removing the need to modify variable 32
33 $mysql_version = mysql_query("SELECT Version() as version");
34 $display_mysql_version = mysql_result($mysql_version,0,"version");
35
36 if ( eregi("3.23",$display_mysql_version) ) {
37 $_isbeta = yes;
38 } else {
39 $_isbeta = no;
40 }
41
42
43 if (empty($limit)) $limit=25;
44
45 // Display queries For debugging 46
47 $verbose_queries=0;
48
49 // Use the mysql database 50
51 $db_name = "mysql";
52
53 // Function mysqlquery() 54 // Used for running queries against database 55 // Database name and Your SQL 56
57 function mysqlquery($db_name,$query)
58 {
59 global $verbose_queries;
60 if ($verbose_queries!=0)
61 echo $query."<BR>";
62 $result = mysql($db_name,$query);
63 return $result;
64 }
65
66 // 67 // 68 ///////////////////////////////////////////////////////////////////////// 69 ?>
| |