Usage of mysql_data_seek function in php

Source: Internet
Author: User
The internal row pointer [internalrowpointer] refers to the position of the row in which the current result is returned through the mysql_query () function. If the function is successfully executed, True is returned. if the execution fails, False bool mysql_data_seek (resource result_identifier, int row_number) is returned)
If the call succeeds, TRUE is returned. if the call fails, FALSE is returned.
Usage:
The function mysql_data_seek () is used to move the internal result (row) pointer.
The internal row pointer [internal row pointer] refers to the position of the row in which the current result is returned through the mysql_query () function.
True is returned if the function is successfully executed. False is returned if the function fails to be executed.
Syntax
Mysql_data_seek (data, row) Note: The mysql_data_seek () function can only be used with the mysql_query () function, but cannot be used with the mysql_unbuffered_query () function.
Instance:
$ SQL = "SELECT * from Person"; $ result = mysql_query ($ SQL, $ con); print_r (mysql_fetch_row ($ result); mysql_data_seek ($ result, 3 );
Print_r (mysql_fetch_row ($ result ));
Mysql_close ($ con);?>
The above code will generate the following results:
Array ([0] => Refsnes [1] => Kai Jim [2] => Taugata) Array
(
[0] => Refsnes
[1] => test
[2] => Sandnes
)

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.