Php + mysql object-oriented simple query of table information-php Tutorial

Source: Internet
Author: User
Php + mysql object-oriented simple query table information self-taught by myself ~ Simple and easy-to-understand code.
If you are not busy, please help me look at the code I wrote,

The web page is blank and I feel like I am still facing the process at the end. what's the problem ~~~
Please advise ~~


Reply to discussion (solution)

In fact, when you do not write code, you can refer to other people's code writing ideas, and then convert them into your own things and learn to use them.
Http://www.oschina.net/code/snippet_96541_3441

There is no problem with what you write.

The constructor does not have database name parameters.

Is it changed
Protected $ _ host;
Protected $ _ root;
Protected $ _ password;
Suitable

Is it difficult to directly use ADODB?

The constructor has only three parameters without the database name. if the database is not selected, no data can be found. this error is obvious.

Your select method does not use mysql_fetch_assoc or mysql_fetch_array to obtain data.
This should be the case

$ Result = mysql_query ("SELECT * FROM users"); $ rows = array () while ($ row = mysql_fetch_assoc ($ result) {$ rows [] = $ row ;} print_r ($ rows );

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.