📄 feedforall_database.inc.php
字号:
<?php//// FeedForAll database access routines//// Copyright 2006 NotePage, Inc.// http://www.feedforall.com//// NotePage, Inc. grants registerd users of our FeedForAll and/or// FeedForAll Mac product(s) the right to install and use the// FeedForAll_database.inc.php script free of charge.// Please refer to the EULA included in the download for full license// terms and conditions.//// $Id: FeedForAll_database.inc.php,v 3.0 2007/04/16 14:23:03 housley Exp $//// ==========================================================================// Below this point of the file there are no user editable options. Your// are welcome to make any modifications that you wish to any of the code// below, but that is not necessary for normal use.// ==========================================================================Function FeedForAll_database_connect($config) { GLOBAL $debugLevel; if ($config["DBtype"] == "mysql") { if (($db = @mysql_connect($config["DBmachine"], $config["DBuser"], $config["DBpassword"])) !== FALSE) { if (mysql_select_db($config["DBdatabase"], $db) !== FALSE) { if (isset($debugLevel) && ($debugLevel >= 3)) { echo "SUCCESS: mysql_connect($config[DBmachine], ********, ********)<br>\n"; echo "SUCCESS: mysql_select_db($config[DBdatabase])<br>\n"; } return TRUE; } else { if (isset($debugLevel) && ($debugLevel >= 1)) { echo "ERROR: mysql_select_db($config[DBdatabase]) => ".mysql_error()."<br>\n"; } } } else { if (isset($debugLevel) && ($debugLevel >= 1)) { echo "ERROR: mysql_connect($config[DBmachine], ********, ********) => ".mysql_error()."<br>\n"; } } return FALSE; } else if ($config["DBtype"] == "mssql") { if (($db = @mssql_connect($config["DBmachine"], $config["DBuser"], $config["DBpassword"])) == NULL) { return FALSE; } if (mssql_errno() == 0) { mssql_select_db($config["DBdatabase"], $db); if (!mssql_errno()) { return TRUE; } } } return FALSE;}Function FeedForAll_database_query($config, $query) { if ($config["DBtype"] == "mysql") { return mysql_query($query); } else if ($config["DBtype"] == "mssql") { return mssql_query($query); } return FALSE;}Function FeedForAll_database_fetch($config, $sql) { if ($config["DBtype"] == "mysql") { return mysql_fetch_array($sql); } else if ($config["DBtype"] == "mssql") { return mssql_fetch_array($sql); } return FALSE;}Function FeedForAll_database_num_rows($config, $sql) { if ($config["DBtype"] == "mysql") { return mysql_num_rows($sql); } else if ($config["DBtype"] == "mssql") { return mssql_num_rows($sql); } return FALSE;}Function FeedForAll_database_errno($config) { if ($config["DBtype"] == "mysql") { return mysql_errno(); } else if ($config["DBtype"] == "mssql") { return 0; } return 0;}Function FeedForAll_database_error($config) { if ($config["DBtype"] == "mysql") { return mysql_error(); } else if ($config["DBtype"] == "mssql") { return NULL; } return NULL;}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -