PHP与MySQL数据库连接
来源:互联网 发布:同济启明星软件 编辑:程序博客网 时间:2024/05/25 05:36
<html><head><title> 浏览数据库中的记录</title><head><center><?phperror_reporting(0);$link = mysqli_connect('localhost', /* The host to connect to 连接MySQL地址 */'root', /* The user to connect as 连接MySQL用户名 */'root', /* The password to use 连接MySQL密码 */'sys'); /* The default database to query 连接数据库名称*/ if (!$link) { printf("Can't connect to MySQL Server. Errorcode: %s ", mysqli_connect_error()); exit; } $result = mysqli_query($link, 'SELECT * FROM sys_config');echo "当前表中的记录有:";echo "<table border=1>";echo "<tr><td>Variable</td><td>Value</td><td>Set_time</td></tr>"; /* Fetch the results of the query 返回查询的结果 */ while( $row = mysqli_fetch_assoc($result) ){ //printf("%s | %s | %s", $row['variable'], $row['value'], $row ['set_time']);echo "<tr>";echo "<td>".$row[variable]."</td>";echo "<td>".$row[value]."</td>";echo "<td>".$row[set_time]."</td>";echo "</tr>";} echo "</table>"; /* Destroy the result set and free the memory used for it 结束查询释放内存 */ mysqli_free_result($result); mysqli_close($link);?> </center></body></html>
阅读全文
1 0
- PHP与MySql数据库连接
- PHP与MySQL数据库连接
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- PHP数据库连接mysql与mysqli的区别与用法
- php数据库连接mysql与mysqli的区别与用法
- php MYSQL数据库连接类
- php+mysql开发--数据库连接
- PHP数据库连接MySQL与mysqli区别和用法
- PHP与Oracle数据库连接
- WPF与MySql数据库连接
- 细谈php mysql数据库连接操作
- 注解(Annotation)结构图
- IT运维工程师们为什么选择使用Linux系统
- JavaScript对象之正则表达式-RegExp
- #HDU 2845 Beans 最大不连续子列和
- win环境 开启pgsql 扩展
- PHP与MySQL数据库连接
- 小白的Python之路
- ios 3Dtouch 照片预览
- hdu 1556 Color the ball
- javascript显示年月日时间代码
- POI导出Excel三
- flv
- EventBus之简单用法
- 你所看到较轻松的Dagger2(使用扩展)