<?php
//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://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_connect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
if (!$conn) {
echo mysql_error();
}
return $conn;
}
function db_query($qstring,$print=0) {
global $sys_dbname;
return @mysql($sys_dbname,$qstring);
}
function db_numrows($qhandle) {
// return only if qhandle exists, otherwise 0
if ($qhandle) {
return @mysql_numrows($qhandle);
} else {
return 0;
}
}
function db_result($qhandle,$row,$field) {
return @mysql_result($qhandle,$row,$field);
}
function db_numfields($lhandle) {
return @mysql_numfields($lhandle);
}
function db_fieldname($lhandle,$fnumber) {
return @mysql_fieldname($lhandle,$fnumber);
}
function db_affected_rows($qhandle) {
return @mysql_affected_rows();
}
function db_fetch_array($qhandle) {
return @mysql_fetch_array($qhandle);
}
function db_insertid($qhandle) {
return @mysql_insert_id($qhandle);
}
function db_error() {
return "\n\n<P><B>".@mysql_error()."</B><P>\n\n";
}
?>
//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://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_connect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
if (!$conn) {
echo mysql_error();
}
return $conn;
}
function db_query($qstring,$print=0) {
global $sys_dbname;
return @mysql($sys_dbname,$qstring);
}
function db_numrows($qhandle) {
// return only if qhandle exists, otherwise 0
if ($qhandle) {
return @mysql_numrows($qhandle);
} else {
return 0;
}
}
function db_result($qhandle,$row,$field) {
return @mysql_result($qhandle,$row,$field);
}
function db_numfields($lhandle) {
return @mysql_numfields($lhandle);
}
function db_fieldname($lhandle,$fnumber) {
return @mysql_fieldname($lhandle,$fnumber);
}
function db_affected_rows($qhandle) {
return @mysql_affected_rows();
}
function db_fetch_array($qhandle) {
return @mysql_fetch_array($qhandle);
}
function db_insertid($qhandle) {
return @mysql_insert_id($qhandle);
}
function db_error() {
return "\n\n<P><B>".@mysql_error()."</B><P>\n\n";
}
?>
版权声明:
本站所有资源均为站长或网友整理自互联网或站长购买自互联网,站长无法分辨资源版权出自何处,所以不承担任何版权以及其他问题带来的法律责任,如有侵权或者其他问题请联系站长删除!站长QQ754403226 谢谢。
- 上一篇: 教你如何把一篇文章按要求分段
- 下一篇: php&java(三)