解析用PHP操作MySql數(shù)據(jù)庫(DB類)(2)_PHP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:淺析php如何判斷來訪網(wǎng)頁地址php利用系統(tǒng)函數(shù)HTTP_REFERER判斷來訪的網(wǎng)頁地址 如注冊用戶時必須是來自某網(wǎng)址的 $str=@$_SERVER[’HTTP_REFERER’];//@為除錯功能 if(strstr($str,www.code-123.com))// echo來自www.code-123.com; else echo其它網(wǎng)址;
function shutdown_query(query_id = ""){
this->shutdown_queries[] = query_id;
}
//取得結(jié)果集中行的數(shù)目,僅對 INSERT,UPDATE 或者 DELETE
function affected_rows() {
return @mysql_affected_rows(this->connection_id);
}
//取得結(jié)果集中行的數(shù)目,僅對 SELECT 語句有效
function num_rows(query_id="") {
if (query_id == "") query_id = this->query_id;
return @mysql_num_rows(query_id);
}
//返回上一個 MySQL 操作中的錯誤信息的數(shù)字編碼
function get_errno(){
this->errno = @mysql_errno(this->connection_id);
return this->errno;
}
//取得上一步 INSERT 操作產(chǎn)生的 ID
function insert_id(){
return @mysql_insert_id(this->connection_id);
}
//得到查詢次數(shù)
function query_count() {
return this->query_count;
}
//釋放結(jié)果內(nèi)存
function free_result(query_id=""){
if (query_id == "") query_id = this->query_id;
@mysql_free_result(query_id);
}
//關(guān)閉 MySQL 連接
function close_db(){
if ( this->connection_id ) return @mysql_close( this->connection_id );
}
//列出 MySQL 數(shù)據(jù)庫中的表
function get_table_names(){
global db_config;
result = mysql_list_tables(db_config["database"]);
num_tables = @mysql_numrows(result);
for (i = 0; i < num_tables; i++) {
tables[] = mysql_tablename(result, i);
}
mysql_free_result(result);
return tables;
}
//從結(jié)果集中取得列信息并作為對象返回,取得所有字段
function get_result_fields(query_id=""){
if (query_id == "") query_id = this->query_id;
while (field = mysql_fetch_field(query_id)) {
fields[] = field;
}
return fields;
}
分享:php教程之語言中switch的用法介紹?php $czc=reg; switch($czc){ case’reg’://注冊 echo注冊的代碼; break;//如果注釋掉此句,將執(zhí)行下在的代碼,否則終止 case’logout’://退出 echo退出的代碼; break; default://此代碼除了reg,logout外其它的都是執(zhí)行以下面的代碼 include’user/in
相關(guān)PHP教程:
- PHPNOW安裝Memcached擴(kuò)展方法詳解
- php記錄頁面代碼執(zhí)行時間
- PHP中獎概率的抽獎算法程序代碼
- apache設(shè)置靜態(tài)文件緩存方法介紹
- php對圖像的各種處理函數(shù)代碼小結(jié)
- PHP 關(guān)于訪問控制的和運(yùn)算符優(yōu)先級介紹
- 關(guān)于PHP語言構(gòu)造器介紹
- php/js獲取客戶端mac地址的實(shí)現(xiàn)代碼
- php5.5新數(shù)組函數(shù)array_column使用
- PHP preg_match的匹配多國語言的技巧
- php 中序列化和json使用介紹
- php采集文章中的圖片獲取替換到本地
- 相關(guān)鏈接:
- 教程說明:
PHP教程-解析用PHP操作MySql數(shù)據(jù)庫(DB類)(2)
。