MySQL function library: mysql_data_seek

Source: Internet
Author: User
Keywords mysql_data_seek mysql function Library php Chinese function manual
Tags aliyun function function library html http internal mysql mysql function library

Mysql_data_seek

(PHP3, PHP4)

Mysql_data_seek---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Moving internal indicators

Syntax: int mysql_data_seek (int result_identifier, int row_number)

Description:

Success returns TRUE, and failure returns false.

Mysql_data_seek () Moves the column metrics within the MySQL to the specified number of columns, and then calls Mysql_fetch_row () returns the column.

The Row_number starting value is 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 ("Cant seek to row%d\n", $i); re-enters;

}

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

re-enters;

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

}

Mysql_free_result ($result);

?>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.