欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

MySQL 數(shù)據(jù)庫(kù)函數(shù)庫(kù)

 更新時(shí)間:2006年12月04日 00:00:00   作者:  
本函數(shù)庫(kù)供存取 MySQL 數(shù)據(jù)庫(kù)。有關(guān) MySQL 的細(xì)節(jié),及下載 MySQL 數(shù)據(jù)庫(kù),請(qǐng)到這個(gè)網(wǎng)址 http://www.mysql.com 。而網(wǎng)絡(luò)上也有許多提供處理 MySQL 的用戶界面程序,建議到 http://www.phpwizard.net/phpMyAdmin 下載 phpMyAdmin,可以使用瀏覽器操作及管理 MySQL。整套 phpMyAdmin 程序,是用 PHP3 完成的,亦可同時(shí)研究 PHP3 與 MySQL 的鏈接。

mysql_affected_rows: 得到 MySQL 最后操作影響的列數(shù)目。 
mysql_close: 關(guān)閉 MySQL 服務(wù)器連接。 
mysql_connect: 打開 MySQL 服務(wù)器連接。 
mysql_create_db: 建立一個(gè) MySQL 新數(shù)據(jù)庫(kù)。 
mysql_data_seek: 移動(dòng)內(nèi)部返回指針。 
mysql_db_query: 送查詢字符串 (query) 到 MySQL 數(shù)據(jù)庫(kù)。 
mysql_drop_db: 移除數(shù)據(jù)庫(kù)。 
mysql_errno: 返回錯(cuò)誤信息代碼。 
mysql_error: 返回錯(cuò)誤信息。 
mysql_fetch_array: 返回?cái)?shù)組資料。 
mysql_fetch_field: 取得字段信息。 
mysql_fetch_lengths: 返回單列各欄資料最大長(zhǎng)度。 
mysql_fetch_object: 返回類資料。 
mysql_fetch_row: 返回單列的各字段。 
mysql_field_name: 返回指定字段的名稱。 
mysql_field_seek: 配置指針到返回值的某字段。 
mysql_field_table: 獲得目前字段的資料表 (table) 名稱。 
mysql_field_type: 獲得目前字段的類型。 
mysql_field_flags: 獲得目前字段的標(biāo)志。 
mysql_field_len: 獲得目前字段的長(zhǎng)度。 
mysql_free_result: 釋放返回占用內(nèi)存。 
mysql_insert_id: 返回最后一次使用 INSERT 指令的 ID。 
mysql_list_fields: 列出指定資料表的字段 (field)。 
mysql_list_dbs: 列出 MySQL 服務(wù)器可用的數(shù)據(jù)庫(kù) (database)。 
mysql_list_tables: 列出指定數(shù)據(jù)庫(kù)的資料表 (table)。 
mysql_num_fields: 取得返回字段的數(shù)目。 
mysql_num_rows: 取得返回列的數(shù)目。 
mysql_pconnect: 打開 MySQL 服務(wù)器持續(xù)連接。 
mysql_query: 送出一個(gè) query 字符串。 
mysql_result: 取得查詢 (query) 的結(jié)果。 
mysql_select_db: 選擇一個(gè)數(shù)據(jù)庫(kù)。 
mysql_tablename: 取得資料表名稱。

mysql_affected_rows
得到 MySQL 最后操作影響的列數(shù)目。
語(yǔ)法: int mysql_affected_rows(int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可得到 MySQL 最后查詢操作 INSERT、UPDATE 或 DELETE 所影響的列 (row) 數(shù)目。若最后的查詢 (query) 是使用 DELETE 而且沒有使用 WHERE 命令,則會(huì)刪除全部資料,本函數(shù)將返回 0。若最后使用的是 SELECT,則用本函數(shù)不會(huì)得到預(yù)期的數(shù)目,因?yàn)橐淖?nbsp;MySQL 數(shù)據(jù)庫(kù)本函數(shù)才有效,欲得到 SELECT 返回的數(shù)目需使用 mysql_num_rows() 函數(shù)。

mysql_close
關(guān)閉 MySQL 服務(wù)器連接。
語(yǔ)法: int mysql_close(int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)關(guān)閉與 MySQL 數(shù)據(jù)庫(kù)服務(wù)器的連接。若無指定參數(shù) link_identifier 則會(huì)關(guān)閉最后的一筆連接。用 mysql_pconnect() 連接則無法使用本函數(shù)關(guān)閉。實(shí)際上本函數(shù)不是一定需要的,當(dāng) PHP 整頁(yè)程序結(jié)束后,將會(huì)自動(dòng)關(guān)閉與數(shù)據(jù)庫(kù)的非永久性 (non-persistent) 連接。成功返回 true、失敗返回 false 值。
參考: mysql_connect() mysql_pconnect()

mysql_connect
打開 MySQL 服務(wù)器連接。
語(yǔ)法: int mysql_connect(string [hostname] [:port], string [username], string [password]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)建立與 MySQL 服務(wù)器的連接。其中所有的參數(shù)都可省略。當(dāng)使用本函數(shù)卻不加任何參數(shù)時(shí),參數(shù) hostname 的默認(rèn)值為 localhost、參數(shù) username 的默認(rèn)值為 PHP 執(zhí)行行程的擁有者、參數(shù) password 則為空字符串 (即沒有密碼)。而參數(shù) hostname 后面可以加冒號(hào)與埠號(hào),代表使用那個(gè)埠與 MySQL 連接。當(dāng)然在使用數(shù)據(jù)庫(kù)時(shí),早點(diǎn)使用 mysql_close() 將連接關(guān)掉可以節(jié)省資源。
使用范例 
這是一位未具名網(wǎng)友提供的范例 (18-Feb-1999) 
<?php 
$dbh = mysql_connect('localhost:3306','mcclain','standard'); 
mysql_select_db('admreqs'); 
$query = "insert into requests(date, request, email, priority,status) values (NOW(),'$description', '$email', '$priority', 'NEW')"; 
$res = mysql_query($query, $dbh); 
$query = "select max(id) from requests"; 
$res = mysql_query($query, $dbh); 
$err = mysql_error(); 
if($err){ 
echo "發(fā)生錯(cuò)誤,請(qǐng)通知<a href=mailto:webmaster@my.site>站長(zhǎng)</a>"; 

$row = mysql_fetch_row($res); 
echo "未來您使用的號(hào)碼為: ".$row[0]; 
?> 
參考: mysql_close() mysql_pconnect()

mysql_create_db
建立一個(gè) MySQL 新數(shù)據(jù)庫(kù)。
語(yǔ)法: int mysql_create_db(string database name, int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)用來建立新的數(shù)據(jù)庫(kù) (database)。在建立前,必須先與服務(wù)器連接。
參考: mysql_drop_db()

mysql_data_seek
移動(dòng)內(nèi)部返回指針。
語(yǔ)法: int mysql_data_seek(int result_identifier, int row_number);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可移動(dòng)內(nèi)部返回的列指針到指定的 row_number 去。之后若使用 mysql_fetch_row() 可以返回新列的值。成功返回 true、失敗則返回 false。

mysql_db_query
送查詢字符串 (query) 到 MySQL 數(shù)據(jù)庫(kù)。
語(yǔ)法: int mysql_db_query(string database, string query, int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)用來送出查詢字符串 (query) 到后端的 MySQL 數(shù)據(jù)庫(kù)中。而可省略的參數(shù) link_identifier 若不存在,程序會(huì)自動(dòng)尋找其它 mysql_connect() 連接后的連接代碼。發(fā)生錯(cuò)誤時(shí)會(huì)返回 false,其它沒錯(cuò)誤時(shí)則返回它的返回代碼。
參考: mysql_connect()

mysql_drop_db
移除數(shù)據(jù)庫(kù)。
語(yǔ)法: int mysql_drop_db(string database_name, int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)移除已存在的數(shù)據(jù)庫(kù)。成功返回 true、失敗則返回 false。
參考: mysql_create_db()

mysql_errno
返回錯(cuò)誤信息代碼。
語(yǔ)法: int mysql_errno(int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到 MySQL 數(shù)據(jù)庫(kù)服務(wù)器的錯(cuò)誤代碼。通常用在 PHP 網(wǎng)頁(yè)程序開發(fā)階段,作為 PHP 與 MySQL 的除錯(cuò)用。
使用范例 
<?php
mysql_connect("marliesle");
echo mysql_errno().": ".mysql_error()."<BR>";
mysql_select_db("nonexistentdb");
echo mysql_errno().": ".mysql_error()."<BR>";
$conn = mysql_query("SELECT * FROM nonexistenttable");
echo mysql_errno().": ".mysql_error()."<BR>";
?> 
參考: mysql_error()

mysql_error
返回錯(cuò)誤信息。
語(yǔ)法: string mysql_error(int [link_identifier]);
返回值: 字符串
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到 MySQL 數(shù)據(jù)庫(kù)服務(wù)器的錯(cuò)誤信息。通常用在 PHP 網(wǎng)頁(yè)程序開發(fā)階段,與 mysql_errno() 一起作為PHP 與 MySQL 的除錯(cuò)用。
參考: mysql_errno()

mysql_fetch_array
返回?cái)?shù)組資料。
語(yǔ)法: array mysql_fetch_array(int result, int [result_typ]);
返回值: 數(shù)組
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)用來將查詢結(jié)果 result 拆到數(shù)組變量中。若 result 沒有資料,則返回 false 值。而本函數(shù)可以說是 mysql_fetch_row() 的加強(qiáng)函數(shù),除可以將返回列及數(shù)字索引放入數(shù)組之外,還可以將文字索引放入數(shù)組中。若是好幾個(gè)返回字段都是相同的文字名稱,則最后一個(gè)置入的字段有效,解決方法是使用數(shù)字索引或者為這些同名的字段 (column) 取別名 (alias)。治募注意的是使用本函數(shù)的處理速度其實(shí)不會(huì)比 mysql_fetch_row() 函數(shù)慢,要用哪個(gè)函數(shù)還是看使用的需求決定。參數(shù) result_typ 是一個(gè)常量值,有以下幾種常量 MYSQL_ASSOC、MYSQL_NUM 與 MYSQL_BOTH。
使用范例 
<?php
mysql_connect($host,$user,$password);
$result = mysql_db_query("database","select * from table");
while($row = mysql_fetch_array($result)) {
echo $row["user_id"];
echo $row["fullname"];
}
mysql_free_result($result);
?>

mysql_fetch_field
取得字段信息。
語(yǔ)法: object mysql_fetch_field(int result, int [field_offset]);
返回值: 類
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)返回的類資料為 result 的字段 (Column) 信息。返回類的屬性如下:
name - 字段名稱 
table - 字段所在表格的資料表名稱 
max_length - 字段的最大長(zhǎng)度 
not_null - 若為 1 表示本字段不能是空的 (null) 
primary_key - 若為 1 表示本字段是主要鍵 (primary key) 
unique_key - 若為 1 表示本字段為不可重覆鍵 (unique key) 
multiple_key - 若為 1 表示本字段為可重覆鍵 (non-unique key) 
numeric - 若為 1 表示本字段為數(shù)字類型 (numeric) 
blob - 若為 1 表示本字段為位類型 (BLOB) 
type - 字段類型 
unsigned - 若為 1 表示本字段為無記號(hào) (unsigned) 
zerofill - 若為 1 表示本字段為被零填滿 (zero-filled) 
參考: mysql_field_seek()

mysql_fetch_lengths
返回單列各欄資料最大長(zhǎng)度。
語(yǔ)法: array mysql_fetch_lengths(int result);
返回值: 數(shù)組
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)將 mysql_fetch_row() 處理過的最后一列資料的各字段資料最大長(zhǎng)度放在數(shù)組變量之中。若執(zhí)行失敗則返回 false 值。返回?cái)?shù)組的第一筆資料索引值是 0。
參考: mysql_fetch_row()

mysql_fetch_object
返回類資料。
語(yǔ)法: object mysql_fetch_object(int result, int [result_typ]);
返回值: 類
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)用來將查詢結(jié)果 result 拆到類變量中。使用方法和 mysql_fetch_array() 幾乎相同,不同的地方在于本函數(shù)返回資料是類而不是數(shù)組。若 result 沒有資料,則返回 false 值。另外治募注意的地方是,取回的類資料的索引只能是文字而不能用數(shù)字,這是因?yàn)轭惖奶匦?。類資料的特性中所有的屬性 (property) 名稱都不能是數(shù)字,因此只好乖乖使用文字字符串當(dāng)索引了。參數(shù) result_typ是一個(gè)常量值,有以下幾種常量 MYSQL_ASSOC、MYSQL_NUM 與 MYSQL_BOTH。關(guān)于速度方面,本函數(shù)的處理速度幾乎和 mysql_fetch_row() 及 mysql_fetch_array() 二函數(shù)差不多,要用哪個(gè)函數(shù)還是看使用的需求決定。
使用范例 
下面的例子示范如使用返回的類。
<?php 
mysql_connect($host,$user,$password);
$result = mysql_db_query("MyDatabase","select * from test");
while($row = mysql_fetch_object($result)) {
echo $row->user_id;
echo $row->fullname;
}
mysql_free_result($result);
?> 
參考: mysql_fetch_array() mysql_fetch_row()

mysql_fetch_row
返回單列的各字段。
語(yǔ)法: array mysql_fetch_row(int result);
返回值: 數(shù)組
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)用來將查詢結(jié)果 result 之單列拆到數(shù)組變量中。數(shù)組的索引是數(shù)字索引,第一個(gè)的索引值是 0。若 result 沒有資料,則返回 false 值。
參考: mysql_fetch_array() mysql_fetch_object() mysql_data_seek() mysql_fetch_lengths() mysql_result()

mysql_field_name
返回指定字段的名稱。
語(yǔ)法: string mysql_field_name(int result, int field_index);
返回值: 字符串
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)用來取得指定字段的名稱。
使用范例 
mysql_field_name($result,2); 

mysql_field_seek
配置指針到返回治募某字段。
語(yǔ)法: int mysql_field_seek(int result, int field_offset);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)配置目前的指針到返回治募特定字段中。
參考: mysql_fetch_field()

mysql_field_table
獲得目前字段的資料表 (table) 名稱。
語(yǔ)法: string mysql_field_table(int result, int field_offset);
返回值: 字符串
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到目前所在字段的資料表名。

mysql_field_type
獲得目前字段的類型。
語(yǔ)法: string mysql_field_type(int result, int field_offset);
返回值: 字符串
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到目前所在字段的類型格式。返回的字符串為字段的類型,包括了 int、real、string、blob....等等,詳見 MySQL 的相關(guān)文件中有關(guān)于類型的部份。
使用范例 
<?php
mysql_connect("localhost:3306");
mysql_select_db("wisconsin");
$result = mysql_query("SELECT * FROM onek");
$fields = mysql_num_fields($result);
$rows = mysql_num_rows($result);
$i = 0;
$table = mysql_field_table($result, $i);
echo "資料表 '".$table."' 有 ".$fields." 欄及 ".$rows." 列。<br>";
echo "本資料表的字段如下<br>";
while ($i < $fields) {
$type = mysql_field_type ($result, $i);
$name = mysql_field_name ($result, $i);
$len = mysql_field_len ($result, $i);
$flags = mysql_field_flags ($result, $i);
echo $type." ".$name." ".$len." ".$flags."<br>";
$i++;
}
mysql_close();
?>

mysql_field_flags
獲得目前字段的標(biāo)志。
語(yǔ)法: string mysql_field_flags(int result, int field_offset);
返回值: 字符串
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到目前所在字段的標(biāo)志。若一個(gè)字段有數(shù)種屬性標(biāo)志,則返回的標(biāo)志為這些屬性連起來的字符串,每個(gè)屬性都用空格隔開,可以使用 explode() 切開這些字符串。返回的標(biāo)志可能是:not_null、primary_key、unique_key、multiple_key、blob、unsigned、zerofill、binary、enum、auto_increment、timestamp。

mysql_field_len
獲得目前字段的長(zhǎng)度。
語(yǔ)法: int mysql_field_len(int result, int field_offset);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到目前所在字段的長(zhǎng)度。

mysql_free_result
釋放返回占用內(nèi)存。
語(yǔ)法: boolean mysql_free_result(int result);
返回值: 布爾值
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以釋放目前 MySQL 數(shù)據(jù)庫(kù) query 返回所占用的內(nèi)存。一般只有在非常擔(dān)心在內(nèi)存的使用上可能會(huì)不足的情形下才會(huì)用本函數(shù)。PHP 程序會(huì)在結(jié)束時(shí)自動(dòng)釋放。

mysql_insert_id
返回最后一次使用 INSERT 指令的 ID。
語(yǔ)法: int mysql_insert_id(int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到最后一次使用 INSERT 到 MySQL 數(shù)據(jù)庫(kù)的執(zhí)行 ID。sleibowitz@btcwcu.org (13-May-1999) 指出在 PHP 3.0.7 版用 REPLACE 也和使用 INSERT 一樣,可以使用本函數(shù)獲得 ID。

mysql_list_fields
列出指定資料表的字段 (field)。
語(yǔ)法: int mysql_list_fields(string database_name, string table_name, int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到指定的資料表的所有字段。返回的字段信息可以供 mysql_field_flags()、mysql_field_len()、mysql_field_name() 及 mysql_field_type() 等函數(shù)使用。若有錯(cuò)誤則返回 -1。

mysql_list_dbs
列出 MySQL 服務(wù)器可用的數(shù)據(jù)庫(kù) (database)。
語(yǔ)法: int mysql_list_dbs(int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到 MySQL 服務(wù)器的可用數(shù)據(jù)庫(kù)。

mysql_list_tables
列出指定數(shù)據(jù)庫(kù)的資料表 (table)。
語(yǔ)法: int mysql_list_tables(string database, int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到指定數(shù)據(jù)庫(kù)中的所有資料表名稱。

mysql_num_fields
取得返回字段的數(shù)目。
語(yǔ)法: int mysql_num_fields(int result);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到返回字段的數(shù)目。
參考: mysql_db_query() mysql_query() mysql_fetch_field() mysql_num_rows()

mysql_num_rows
取得返回列的數(shù)目。
語(yǔ)法: int mysql_num_rows(int result);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可以得到返回列的數(shù)目。
參考: mysql_db_query() mysql_query() mysql_fetch_row()

mysql_pconnect
打開 MySQL 服務(wù)器持續(xù)連接。
語(yǔ)法: int mysql_pconnect(string [hostname] [:port], string [username], string [password]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)和 mysql_connect() 雷同。不同的地方在于使用本函數(shù)打開數(shù)據(jù)庫(kù)時(shí),程序會(huì)先尋找是否曾經(jīng)執(zhí)行過本函數(shù),若執(zhí)行過則返回先前執(zhí)行的 ID。另一個(gè)不同的地方是本函數(shù)無法使用 mysql_close() 關(guān)閉數(shù)據(jù)庫(kù)。

mysql_query
送出一個(gè) query 字符串。
語(yǔ)法: int mysql_query(string query, int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)送出 query 字符串供 MySQL 做相關(guān)的處理或者執(zhí)行。若沒有指定 link_identifier 參數(shù),則程序會(huì)自動(dòng)尋找最近打開的 ID。當(dāng) query 查詢字符串是 UPDATE、INSERT 及 DELETE 時(shí),返回的可能是 true 或者 false;查詢的字符串是 SELECT 則返回新的 ID 值。joey@samaritan.com (09-Feb-1999) 指出,當(dāng)返回 false 時(shí),并不是執(zhí)行成功但無返回值,而是查詢的字符串有錯(cuò)誤。
參考: mysql_db_query() mysql_select_db() mysql_connect() 

mysql_result
取得查詢 (query) 的結(jié)果。
語(yǔ)法: int mysql_result(int result, int row, mixed field);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)取得一格 query 的結(jié)果。參數(shù) field 可以是字段名稱、順序或者是 FieldName.TableName 的格式。在返回資料量少時(shí),可以使用本函數(shù)來處理。當(dāng)數(shù)據(jù)庫(kù)大時(shí),本函數(shù)的效率就有待考量了,這時(shí)可以使用較有效率的 mysql_fetch_row()、mysql_fetch_array() 及 mysql_fetch_object() 等函數(shù)。

mysql_select_db
選擇一個(gè)數(shù)據(jù)庫(kù)。
語(yǔ)法: int mysql_select_db(string database_name, int [link_identifier]);
返回值: 整數(shù)
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)選擇 MySQL 服務(wù)器中的數(shù)據(jù)庫(kù)以供之后的資料查詢作業(yè) (query) 處理。成功返回 true,失敗則返回 false。
參考: mysql_connect() mysql_pconnect() mysql_query()

mysql_tablename
取得資料表名稱。
語(yǔ)法: string mysql_tablename(int result, int i);
返回值: 字符串
函數(shù)種類: 數(shù)據(jù)庫(kù)功能
內(nèi)容說明: 本函數(shù)可取得資料表名稱字符串,一般配合 mysql_list_tables() 函數(shù)使用,取得該函返回的數(shù)字的名稱字符串。
使用范例 
<?php 
mysql_connect ("localhost:3306");
$result = mysql_list_tables ("wisconsin");
$i = 0;
while ($i < mysql_num_rows ($result)) {
$tb_names[$i] = mysql_tablename ($result, $i);
echo $tb_names[$i] . "<BR>";
$i++;
}
?>

相關(guān)文章

  • Mysql修改server uuid的方法分享

    Mysql修改server uuid的方法分享

    這篇文章主要給大家介紹了關(guān)于Mysql修改server uuid的方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2018-09-09
  • Mysql Explain 詳細(xì)介紹

    Mysql Explain 詳細(xì)介紹

    這篇文章主要介紹了Mysql Explain 詳細(xì)介紹的相關(guān)資料,這里對(duì)Mysql Explain 的語(yǔ)法,屬性,以及如何使用,做了全面介紹,需要的朋友可以參考下
    2016-11-11
  • MySQL實(shí)現(xiàn)導(dǎo)出excel的方法分析

    MySQL實(shí)現(xiàn)導(dǎo)出excel的方法分析

    這篇文章主要介紹了MySQL實(shí)現(xiàn)導(dǎo)出excel的方法,結(jié)合實(shí)例形式分析了基于php、js等方法實(shí)現(xiàn)mysql導(dǎo)出Excel的相關(guān)操作技巧,需要的朋友可以參考下
    2018-03-03
  • Win7x64下Mysql5.7.18解壓版的安裝方法

    Win7x64下Mysql5.7.18解壓版的安裝方法

    這篇文章主要介紹了Win7x64下Mysql5.7.18解壓版的安裝方法,需要的朋友可以參考下
    2017-07-07
  • MySQL系列教程小白數(shù)據(jù)庫(kù)基礎(chǔ)

    MySQL系列教程小白數(shù)據(jù)庫(kù)基礎(chǔ)

    這篇文章主要為大家介紹了MySQL系列中的數(shù)據(jù)庫(kù)基礎(chǔ),非常適合數(shù)據(jù)庫(kù)小白的入門基礎(chǔ)篇,詳細(xì)的講解了數(shù)據(jù)庫(kù)的基本概念以及基礎(chǔ)命令及操作示例,有需要的朋友可以借鑒參考下
    2021-10-10
  • MySQL快速對(duì)比數(shù)據(jù)技巧

    MySQL快速對(duì)比數(shù)據(jù)技巧

    這篇文章主要介紹了MySQL快速對(duì)比數(shù)據(jù)的方法以及技巧分享,如果對(duì)此有興趣,一起跟著小編學(xué)習(xí)下吧。
    2018-02-02
  • mysql中多表刪除其中ID相同記錄的方法

    mysql中多表刪除其中ID相同記錄的方法

    這篇文章主要介紹了mysql中多表刪除其中ID相同記錄的方法,需要的朋友可以參考下
    2014-04-04
  • mysql中的delete,drop和truncate有什么區(qū)別

    mysql中的delete,drop和truncate有什么區(qū)別

    這篇文章主要介紹了mysql中的delete,drop和truncate有什么區(qū)別,三者的用法和使用場(chǎng)景又完全不同,接下來我們來看看具體的區(qū)別吧,希望對(duì)你的學(xué)習(xí)有所幫助
    2022-06-06
  • 詳解一條update語(yǔ)句是怎樣執(zhí)行原理解析

    詳解一條update語(yǔ)句是怎樣執(zhí)行原理解析

    這篇文章主要為大家介紹了詳解一條update語(yǔ)句是怎樣執(zhí)行原理解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-12-12
  • Mysql數(shù)據(jù)庫(kù)設(shè)計(jì)三范式實(shí)例解析

    Mysql數(shù)據(jù)庫(kù)設(shè)計(jì)三范式實(shí)例解析

    這篇文章主要介紹了Mysql數(shù)據(jù)庫(kù)設(shè)計(jì)三范式實(shí)例解析,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-04-04

最新評(píng)論