hholzgra Fri Sep 20 07:31:28 2002 EDT
Added files:
/functable/lib dbconnect.php
Modified files:
/functable dslgen table.php xslgen
Log:
use central db connect
Index: functable/dslgen
diff -u functable/dslgen:1.9 functable/dslgen:1.10
--- functable/dslgen:1.9 Fri Sep 20 07:16:23 2002
+++ functable/dslgen Fri Sep 20 07:31:27 2002
@@ -10,9 +10,7 @@
$func = array();
$ver = array();
-$db = mysql_connect($dbhost, $dbuser, $dbpass);
-if(! $db) { echo mysql_error(); exit; }
-if(! mysql_select_db($dbname)) { echo mysq_error(); exit;}
+require_once "lib/dbconnect.php";
$result = mysql_query("select distinct version,versionid from funclist");
if(!$result) { echo mysql_error(); exit; }
Index: functable/table.php
diff -u functable/table.php:1.9 functable/table.php:1.10
--- functable/table.php:1.9 Tue May 28 07:46:54 2002
+++ functable/table.php Fri Sep 20 07:31:27 2002
@@ -2,6 +2,10 @@
<?
# {{{ init
+include "config.php";
+require_once "lib/dbconnect.php";
+
+
// initial values ...
$db_server="localhost";
$db_user ="phpdoc";
@@ -40,11 +44,6 @@
set_time_limit(0);
error_reporting(E_ALL - E_NOTICE);
ob_implicit_flush();
-
-$db = mysql_connect($db_server,$db_user,$db_passwd);
-if(! $db) { echo "no response from database server\n"; exit; }
-if(! mysql_select_db($db_name)) { echo "database not found on server\n";exit;}
-
$urlok_cache = array();
Index: functable/xslgen
diff -u functable/xslgen:1.6 functable/xslgen:1.7
--- functable/xslgen:1.6 Fri Sep 20 07:16:23 2002
+++ functable/xslgen Fri Sep 20 07:31:27 2002
@@ -9,9 +9,7 @@
$func = array();
$ver = array();
-$db = mysql_connect($dbhost, $dbuser, $dbpass);
-if(! $db) { echo mysql_error(); exit; }
-if(! mysql_select_db($dbname)) { echo mysq_error(); exit;}
+require_once "lib/dbconnect.php";
$result = mysql_query("select distinct version,versionid from funclist");
if(!$result) { echo mysql_error(); exit; }
@@ -98,8 +96,7 @@
} else {
if($max==99) { $ver4.=">= ".$ver[$min+400]; }
else if ($min==$max) {$ver4.=$ver[$min+400]." only";}
- else { $ver4=$ver[$min+400]." - ".$ver[$max+400]."
-only";}
+ else { $ver4=$ver[$min+400]." - ".$ver[$max+400]." only";}
}
} else {
$ver4 = "";
Index: functable/lib/dbconnect.php
+++ functable/lib/dbconnect.php
<?php
$db = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $db) { echo mysql_error(); exit; }
if(! mysql_select_db($dbname)) { echo mysq_error(); exit;}
?>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php