一個用於mysql的數據庫抽象層函數庫

<?php(做為現在的主流開發語言)
//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// https://sourceforge.net
//
// $Id: database.php(做為現在的主流開發語言),v 1.6 2000/04/11 14:17:13 cvs Exp $
//
// /etc/local.inc includes the machine specific database connect info

function db_connect() {
global $sys_dbhost,$sys_dbuser,$sys_dbpasswd;
$conn = MySQL(和PHP搭配之最佳組合)_connect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
if (!$conn) {
echo MySQL(和PHP搭配之最佳組合)_error();
}
return $conn;
}

function db_query($qstring,$print=0) {
global $sys_dbname;
return @MySQL(和PHP搭配之最佳組合)($sys_dbname,$qstring);
}

function db_numrows($qhandle) {
// return only if qhandle exists, otherwise 0
if ($qhandle) {
return @MySQL(和PHP搭配之最佳組合)_numrows($qhandle);
} else {
return 0;
}
}

function db_result($qhandle,$row,$field) {
return @MySQL(和PHP搭配之最佳組合)_result($qhandle,$row,$field);
}

function db_numfields($lhandle) {
return @MySQL(和PHP搭配之最佳組合)_numfields($lhandle);
}

function db_fieldname($lhandle,$fnumber) {
return @MySQL(和PHP搭配之最佳組合)_fieldname($lhandle,$fnumber);
}

function db_affected_rows($qhandle) {
return @MySQL(和PHP搭配之最佳組合)_affected_rows();
}

function db_fetch_array($qhandle) {
return @MySQL(和PHP搭配之最佳組合)_fetch_array($qhandle);
}

function db_insertid($qhandle) {
return @MySQL(和PHP搭配之最佳組合)_insert_id($qhandle);
}

function db_error() {
return ”

<P><B>”.@MySQL(和PHP搭配之最佳組合)_error().”</B><P>

“;
}

?>

  
  

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *