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 );