本文主要向大家介绍了PHP语言学习之PHP7.0连接MYSQL数据库代码,通过具体的内容向大家展示,希望对大家学习php语言有所帮助。
1.
=‘localhost‘;
="root";
="qmtg";
="testmydatabase";
= mysqli(,,);
(== "数据连接失败!" "数据连接成功!"->query("set names ‘utf8‘");
-> select_db();
="select * from testtale ";
= ->query();
= "start" (=->[]=( "end"?>
2.
=‘localhost‘;
="root";
="qmtg";
="testmydatabase";
= mysqli(,,);
(== "数据连接失败!" "数据连接成功!"->query("set names ‘utf8‘");
-> select_db();
="select * from testtale ";
= ->query();
= "start" (=->[]= [‘name‘] .
"end"?>
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标编程语言PHP频道!