In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use mysql_fetch_object () to return query results in the form of an object. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Mysql_fetch_object () is also used to get the result set of query data, return the current row of data, and automatically slide to the next row. But unlike mysql_fetch_row () and mysql_fetch_array (), it returns an object whose property collection is the data property collection, and the value on the property is the value on the current row in the database. The function is defined as follows.
The copy code is as follows:
Object mysql_fetch_object (int result, int [result_type])
The parameter description is the same as mysql_fetch_array ().
The return value is as follows.
Success: an object whose property name corresponds to the property name in the result set, and the value of the property is the corresponding property value in the result set.
Failed: false.
The following is an example of using mysql_fetch_object (): query the book information in the data table Computers.
The copy code is as follows:
one
two
The example uses mysql_fetch_object () on line 12 to get the data for the current row and outputs it through a loop of 12 through 18 lines. During the output process, the value of the row of data on its attributes is obtained through the object operator "- >".
This is the end of this article on "how to use mysql_fetch_object () to return query results in the form of objects". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
The type PipeWriter copy code is as follows:
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.