In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "the method of php query mysql data display". In the daily operation, I believe that many people have doubts about the method of php query mysql data display. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "php query mysql data display method". Next, please follow the editor to study!
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
How does php query mysql data display?
PHP+MYSQL to query the database
I. basic code
Mysql_connect (): used to establish a connection to the MYSQL database, there are five parameters, usually only the first three parameters are used. The three parameters are the MySQL server address, user name, and password.
Mysql_select_db (): used to specify the database to operate on. If the database you want to operate on has not yet been created, create the database first, and then create the tables in the database.
Mysql_query (): a special function for query instructions through which all SQL statements are executed and return the result set.
Mysql_fetch_row (): takes a row from the result set as enumerated data, takes a row from the result set associated with the specified result ID, and returns it as an array.
Mysql_fetch_array (): get a row from the result set as an associative array, or an array of numbers, or both. In addition to storing the data in the array as a digital index, you can also store the data as an associative index, using the field name as the key name.
Mysql_fetch_object (): take a row from the result set as an object and use the field name as a property.
Mysql_fetch_assoc (): get a row from the result set as an associative array, which means that this function cannot take values with indexes like mysql_fetch_row, but only with field names.
Mysql_num_rows (): gets the number of rows in the result set queried by the select statement
2. Examples
III. Examples
PHP page querytest.php
Untitled document serial number user name password here, on the "php query mysql data display method" study is over, I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.