最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 连接数据库并显示所要的数据
时间:2022-06-24 19:13:34 编辑:袖梨 来源:一聚教程网
| 代码如下 | 复制代码 |
|
$Host="localhost"; $MySQL_UserName="root"; $MySQL_UserPass="password"; $MySQL_Database="db"; $Query="SELECT * FROM domain"; if (!mysql_connect ($Host, $MySQL_UserName, $MySQL_UserPass)){ print "Cannot connect to MySQL: ".mysql_error(); exit; } if (!mysql_select_db ($MySQL_Database)){ print "Cannot select db exit; } if (!$Result_ID=mysql_query ($Query)){ print "Query Error: ".mysql_error(); exit; } while ($Result=mysql_fetch_row($Result_ID)){ print "------------------ print "$Result[0] print "$Result[1] print "$Result[2] print "$Result[3] print "------------------- }?> |
|
相关文章
- Owhat平台官方入口 - 2026最新版下载与使用指南 06-27
- 中国知网官网入口 - 2026年CNKI学术资源平台 06-27
- 一耽漫画官方下载入口 - 2026最新正版安装包 06-27
- Gmail邮箱官网登录页面 - 2026最新网页版入口 06-27
- 粉笔题库官网入口 - 2026最新在线刷题平台 06-27
- 博客园官网登录入口 - 2026年最新账号登录页面 06-27