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