In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the method for php mysql to judge whether there is data or not". In daily operation, I believe that many people have doubts about the method of php mysql to judge whether there is data or not. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for everyone to answer the doubts of "what is the method of php mysql to judge whether there is data or not?" Next, please follow the editor to study!
1. Create a sample PHP file.
2. Get the number of rows of the select result set.
3. Returns the number of rows affected by the last operation.
4. Judge whether there is data or not through the code of sql query function.
Example
/ / method 1: $sql = "select * from `student`where `age` ='16 years;"; $rows = mysql_query ($rs);? > if (mysql_num_rows ($rs)
< 1){ echo '查询无数据!'; }else{ while($rows=mysql_fetch_array($rs)){ ?>Name: gender: age: grade: class:}}? > / method 2$ sql = "select * from `student`where `age` = '1600;"; $rows = mysql_query ($rs) ? > if (mysql_affected_rows ()) {while ($rows=mysql_fetch_assoc ($rs)) {? > name: gender: age: grade: class:}} else {echo "No data!" At this point, the study of "what is the method for php mysql to judge whether there is data or not" is over. I hope to be able to solve your 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.