Php+mysql information for object-oriented simple query tables

Source: Internet
Author: User
I am a novice self-learning ~ to find easy to understand code.
If you're not busy, help me look at the code I wrote,

Page blank, write to the end I feel I am still in the face of the process, how to go back ~ ~ ~
Ask for advice ~ ~


Reply to discussion (solution)

In fact, when you do not write code, you can refer to someone else to write the idea of code, and then into their own things, to apply.
http://www.oschina.net/code/snippet_96541_3441

There's nothing wrong with what you wrote.

Constructor does not have database name parameter

Is it a change?
protected $_host;
protected $_root;
protected $_password;
Right

Is it okay to use ADODB directly?

constructor only 3 parameters without database name, no choice to the library, can not find out the data, this error is more obvious

Your Select method does not use MYSQL_FETCH_ASSOC or mysql_fetch_array to get the data, so there is no result.
It should be.

$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.