001.PHP用于mysql的数据库抽象层函数库讲解

【字号: 日期:2024-08-31浏览:34作者:雯心
PHP用于mysql的数据库抽象层函数库讲解

PHP用于mysql的数据库抽象层函数库 代码如下:

<?php // // SourceForge: Breaking Down the Barriers to Open Source Development // Copyright 1999-2000 (c) The SourceForge Crew // http://sourceforge.net // // : 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 ,,; = mysql_connect(,,); if (!) { echo mysql_error(); } return ; } function db_query(,=0) { global ; return @mysql(,); } function db_numrows() { // return only if qhandle exists, otherwise 0 if () { return @mysql_numrows(); } else { return 0; } } function db_result(,Array,) { return @mysql_result(,Array,); } function db_numfields() { return @mysql_numfields(); } function db_fieldname(,) { return @mysql_fieldname(,); } function db_affected_rows() { return @mysql_affected_rows(); } function db_fetch_array() { return @mysql_fetch_array(); } function db_insertid() { return @mysql_insert_id(); } function db_error() { return " <P><B>".@mysql_error()."</B><P> "; } ?>

以上就是001.PHP用于mysql的数据库抽象层函数库讲解,希望大家喜欢,请继续关注乐呵呵网。
相关文章: