Three methods for querying mysql data by using php
Source: Internet
Author: User
Three methods for accessing and querying mysql data in php, read three methods for accessing and querying mysql data in php, 1. $ row = mysql_fetch_row ($ result); returns a regular array $ row, $ row [0] is the first element, and $ row [1] is the second element, and so on... mysql_num_fields ($ result) returned result RMB 1. $ row = mysql_fetch_row ($ result );
Returns a regular array $ row. $ row [0] is the first element, $ row [1] is the second element, and so on...
The number of elements returned by mysql_num_fields ($ result.
2. $ row = mysql_fetch_array ($ result );
Returns an array $ row. for example:
The table structure is as follows:
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.