cvs: functable /lib dbconnect.php extensions_4.php proto2xml.php

[email protected] ("Hartmut Holzgraefe")
Newsgroups php.doc.web
Message-ID <cvshholzgra1125767224@cvsserver>
hholzgra		Sat Sep  3 13:07:04 2005 EDT

  Modified files:              
    /functable/lib	dbconnect.php extensions_4.php proto2xml.php 
  Log:
  conversion to mini 'abstraction' layer finished
  
  
http://cvs.php.net/diff.php/functable/lib/dbconnect.php?r1=1.4&r2=1.5&ty=u
Index: functable/lib/dbconnect.php
diff -u functable/lib/dbconnect.php:1.4 functable/lib/dbconnect.php:1.5
--- functable/lib/dbconnect.php:1.4	Sat Sep  3 11:55:12 2005
+++ functable/lib/dbconnect.php	Sat Sep  3 13:07:03 2005
@@ -27,9 +27,14 @@
 	return mysql_free_result($result) or die(mysql_error());
 }
 
-function db_escape($result)
+function db_escape($text)
 {
-	reutrn mysql_real_escape_string($result) or die(mysql_error());
+	reutrn mysql_real_escape_string($text) or die(mysql_error());
+}
+
+function db_numrows($result)
+{
+	return mysql_numrows($result);
 }
 
 function db_close()
http://cvs.php.net/diff.php/functable/lib/extensions_4.php?r1=1.1&r2=1.2&ty=u
Index: functable/lib/extensions_4.php
diff -u functable/lib/extensions_4.php:1.1 functable/lib/extensions_4.php:1.2
--- functable/lib/extensions_4.php:1.1	Tue May 28 07:31:57 2002
+++ functable/lib/extensions_4.php	Sat Sep  3 13:07:03 2005
@@ -11,11 +11,11 @@
         ORDER BY extension
                , function
 ";
-$result = mysql_query($query);
+$result = db_query($query);
 
 reset($extensions);
 $extension = " ";
-while($row=mysql_fetch_array($result)) { 
+while($row=db_fetch($result)) { 
 	$function=$row["function"];
 	if($row["extension"]!=$extension) {
 		if(trim($extension)) {
@@ -79,7 +79,7 @@
   print("</tr>\n");
 }
 
-mysql_free_result($result);
+db_free($result);
 print("</table>\n");
 foot("$outdir/extension.$extension.$ext");
 
http://cvs.php.net/diff.php/functable/lib/proto2xml.php?r1=1.1&r2=1.2&ty=u
Index: functable/lib/proto2xml.php
diff -u functable/lib/proto2xml.php:1.1 functable/lib/proto2xml.php:1.2
--- functable/lib/proto2xml.php:1.1	Tue May 28 07:32:08 2002
+++ functable/lib/proto2xml.php	Sat Sep  3 13:07:03 2005
@@ -149,8 +149,6 @@
 	return	$function_refentries;
 }
 
-mysql_connect("localhost","phpdoc","phpdoc");
-mysql_select_db("phpdoc");
 header("Content-type: text/plain");
 
 if(is_array($function)) {
@@ -165,16 +163,16 @@
           FROM proto4
          WHERE $function
        ";
-$res=mysql_query($query);
+$res = db_query($query);
 
-if(mysql_numrows($res)) {
-	while($row=mysql_fetch_assoc($res)) 
+if(db_numrows($res)) {
+	while($row = db_fetch($res)) 
 		echo gen_proto("$row[proto] $row[proto_desc]")."\n\n";
 } else {
 	echo "no proto available\n\n$query";
 	print_r($row);
 }
 
-mysql_free_result($res);
+db_free($res);
 
 ?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.