MySQL函数库:mysql_data_seek

mysql_data_seek

(PHP3 , PHP4)

mysql_data_seek ---&">nbsp; 移动内部指标

语法 : int mysql_data_seek (int result_identifier, int row_number)

说明 :

成功则传回true,失败则传回false。

mysql_data_seek( )移动MySQL内部的列指标到指定列的数目,之后以呼叫mysql_fetch_row( )将会传回此列。

row_number起始值为0。

Example :

<?php

$link = mysql_pconnect ("kron", "jutta", "geheim") or die ("Could not connect");

mysql_select_db ("samp_db") or die ("Could not select database");

$query = "SELECT last_name, first_name FROM friends";

$result = mysql_query ($query) or die ("Query failed");

# fetch rows in reverse order

for ($i = mysql_num_rows ($result) - 1; $i >=0; $i--) {

if (!mysql_data_seek ($result, $i)) {

printf ("Cannot seek to row %d\n", $i); continue;

}

if(!($row = mysql_fetch_object ($result)))

continue;

printf ("%s %s<BR>\n", $row->last_name, $row->first_name);

}

mysql_free_result ($result);

?>

时间: 2024-09-16 05:54:00

MySQL函数库:mysql_data_seek的相关文章

MySQL函数库:mysql_errno

mysql_errno (PHP3 , PHP4) mysql_errno --- 从先前MySQL操作传回错误讯息代号 语法 : int mysql_errno ([int link_identifier]) 说明 : 从最后的MySQL函数传回错误讯息代号,如果没有发生错误则传回0(zero). 从MySQL资料库所传回来的错误可以使用mysql_errno( )来获得错误代号,注意 : 此函数只从最近执行MySQL函数 (不包含mysql_error( )与mysql_errno( ) )

MySQL函数库:mysql_result

mysql_result (PHP3 , PHP4) mysql_result ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 取得结果资料 语法 : int mysql_result (int result, int row [, mixed field]) 说明 : mysql_result( )从MySQL结果传回一格(cell)的内容,参数field可以是栏位的偏移量(offset).栏位的名称.或

MySQL函数库:mysql_query

mysql_query mysql_query ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 送出MySQL查询 语法 : int mysql_query (string query [, int link_identifier]) 说明 : mysql_query( )送出查询到伺服器上现行的资料库,如果 link_identifier没有指定,则假定是最后开启的连结,如果是没有开启的连结,此函数会试着

MySQL函数库:mysql_pconnect

mysql_pconnect (PHP3 , PHP4) mysql_pconnect ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 开启MySQL伺服器持续连线 语法 : int mysql_pconnect ([string hostname [:port] [:/path/to/socket] [, string username [, string password]]]) 说明 : 成功则传回一

MySQL函数库:mysql_db_query

mysql_db_query (PHP3 , PHP4) mysql_db_query ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 送出MySQL查询 语法 : int mysql_db_query (string database, string query [, int link_identifier]) 说明 : 成功则传回一正数的MySQL查询结果identifier,失败则传回false. m

MySQL函数库:mysql_field_type

mysql_field_type (PHP3 , PHP4) mysql_field_type ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 取得指定栏位的型态 语法 : string mysql_field_type (int result, int field_offset) 说明 : mysql_field_type( )类似于mysql_field_name( ),参数也一样,但是此函数所传回的是

MySQL函数库:mysql_change_user

mysql_change_user (PHP3 >= 3.0.13) mysql_change_user ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 更改连线的使用者 语法 : int mysql_change_user (string user, string password [, string database [, int link_identifier]]) 说明 : mysql_cha

MySQL函数库:mysql_affected_rows

mysql_affected_rows (PHP3 , PHP4) mysql_affected_rows ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 取得先前操作MySQL所受到影响的列的数目 语法 : int mysql_affected_rows ([int link_identifier]) 说明 : mysql_affected_rows( )传回最后查询为INSERT.UPDATE或DELE

MySQL函数库:mysql_close

mysql_close (PHP3 , PHP4) mysql_close ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 关闭MySQL连线 语法 : int mysql_close ([int link_identifier]) 说明 : 成功则传回true,失败则传回false. mysql_close( )关闭连结到MySQL资料库的连线,如果没有指定link_identifier,将会关闭最后与M