PHPMYSQL help! What should I do?

Source: Internet
Author: User
Tags php mysql
PHPMYSQL help !!!! ThinkPHP Framework & nbsp; publicfunctionselect () {& nbsp; $ db_dsn & quot; mysql: root: [email & #160; protected]: 3306my_table & quot; & nbsp; $ dbnewDb ($ db_dsn) php mysql help !!!!
ThinkPHP framework
Public function select (){
$ Db_dsn = "mysql: // root: [email protected]: 3306/my_table ";
$ Db = new Db ($ db_dsn );
Echo $ db-> execute ("select * from think_person ");
}

Http: // 127.0.0.1/iBaby/index. php/Index/select

When the database is set to all-right, how does it become blank after access? Can someone help me?

------ Solution --------------------
Echo $ db-> execute ("select * from think_person ");

You can change it to dump ($ db-> execute ("select * from think_person.

++

Configure the database as follows:
// 'Config maps '=> 'configuration value'
'Db _ type' => 'mysql ',
'Db _ host' => 'localhost ',
'Db _ name' => 'test ',
'Db _ user' => 'root ',
'Db _ pwd' => '123 ',
'Db _ port' => '123 ',
'Db _ prefix' => 'think _',
Write an Action:
Function get_data ()
{
$ Db = M ('user ');
Dump ($ db-> where ('Id = 1')-> select ());
}

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.