铭哥和佩佩的博客

铭哥和佩佩的博客分享Python、PHP、JavaScript、HTML5、CSS3等各种知识

Redis链接和Mysql链接(原生)

在此简单介绍redis的操作,至于Redis的安装,附上参考文件链接(https://www.cnblogs.com/weiqinl/p/6490372.html)

// 测试redis
$redis = new redis();
$redis->connect('127.0.0.1', 6379);
$redis->set('test',"佩小姐最美丽");
$result = $redis->get('test');
var_dump($result);
// 测试数据库
$con = mysqli_connect("localhost","root","123456");
if (!$con){
    die('Could not connect: ' . mysql_error());
  }else{
    echo "success !";
  }

mysqli_close($con);

none

添加新评论