1 Star 0 Fork 2

杨洋 / PHP静态资源输出

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
connectMysql.php 767 Bytes
一键复制 编辑 原始数据 按行查看 历史
yangyang 提交于 2020-08-24 11:03 . PHP静态资源输出
<?php
header("Content-type:text/html;charset=utf-8");
$res = mysqli_connect("localhost","root","");
if(!$res){
echo "链接数据库失败";
}else{
echo "链接数据库成功";
}
/**
php连接mysql的方法
第一步:建立连接和认证
$link = @ mysql_connect("localhost:3306", '用户名', '密码');
// var_dump($link);
if(!$link) {
// 说明数据库连接失败
die('对不起,服务器繁忙!');
}
第二步:发生送操作指令
$sql = 'select * from ………………';
// $link是连接资源,如果省略,默认的就为最后一次打开的连接资源
$result = mysql_query($sql, $link);
// 第三步:提取资源结果集
$row = mysql_fetch_array($result);
var_dump($row);
第四步:断开连接
mysql_close($link);
*/
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/yangyang880606/php-static-resource-output.git
git@gitee.com:yangyang880606/php-static-resource-output.git
yangyang880606
php-static-resource-output
PHP静态资源输出
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891