PHP Operation Mysql_fetch_row with Mysql_fetch_assoc's line don't understand hey
Source: Internet
Author: User
PHP Operation Mysql_fetch_row and MYSQL_FETCH_ASSOC a line don't understand hey
mysql_fetch_assoc-getting a row from the result set as an associative array
mysql_fetch_row-a row from the result set as an enumerated array
Gets a row from the result set is this the first row or a random row in the result set?
------to solve the idea----------------------
mysql_fetch_assoc-returns an array (array (' ID ' =>2, ' name ' = ' abc ', ' Sex ' =>0));
mysql_fetch_row-returns an array (Array (2, ' abc ', 0));
Do you understand me?
------to solve the idea----------------------
Take a line from the position of the pointer, and then the pointer + +.
All rows in the result set are exhausted, and if you want to take the first row again, you need to restore the pointer to line NO. 0, Mysql_data_seek
------to solve the idea----------------------
Get the first row of data from the result set, not randomly!
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.