In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to move the pointer to the initial position of the dataset in php". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor learn how to move the pointer to the initial position of the dataset in php.
The copy code is as follows:
Definition and usage
The mysql_data_seek () function moves the pointer to the internal result.
Grammar
Description of mysql_data_seek (data,row) parameters
Data is required. Returns a result set of type resource. The result set is obtained from the call to mysql_query ().
Row is required. The number of rows of the new result set pointer you want to set. 0 indicates the first record.
Description
Mysql_data_seek () moves the row pointer inside the MySQL result specified by the data parameter to the specified line number.
The call to mysql_fetch_row () then returns that row.
Row starts at 0. The value of row should range from 0 to mysql_num_rows-1.
But if the result set is empty (mysql_num_rows () = = 0), moving the pointer to 0 will fail and issue an E_WARNING-level error, mysql_data_seek () will return false.
Return value
True is returned if successful, false is returned if failed.
Tips and comments
Note: mysql_data_seek () can only be used with mysql_query (), not with mysql_unbuffered_query ().
Examples
The copy code is as follows:
Output:
The copy code is as follows:
Array
(
[0] = > Adams
[1] = > John
[2] = > London
)
Array
(
[0] = > Carter
[1] = > Thomas
[2] = > Beijing
)
At this point, I believe you have a deeper understanding of "how to achieve the function of moving the pointer to the initial position of the dataset in php". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.