12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- //phpinfo();
- ////连接本地的 Redis 服务
- //$redis = new Redis();
- //$res=$redis->connect('47.98.201.73', 6379);
- //echo $res;
- //echo "Connection to server successfully";
- ////查看服务是否运行
- //echo "Server is running: " . $redis->ping();
- header("Content-type:text/html;charset=utf-8");
- function query_187_jdxf($sql){
- $link = mysqli_connect('localhost', 'a0313085524', '1f84d01e', 'a0313085524', 3306);
- mysqli_query($link,"set character set 'utf8'");
- $res1 = mysqli_query($link,$sql);
- if($res1==FALSE){
- return $list=null;
- }
- $list=array();
- while ($row = $res1->fetch_assoc()) {
- $list[]=$row;
- }
- mysqli_free_result($res1);
- mysqli_close($link);
- return $list;
- }
- function insert_187_jdxf($sql){
- $link = mysqli_connect('localhost', 'a0313085524', '1f84d01e', 'a0313085524', 3306);
- mysqli_query($link,"set character set 'utf8'");
- $res1 = mysqli_query($link,$sql);
- mysqli_close($link);
- return $res1;
- }
- $R=query_187_jdxf("show databases");
- print_r($R);
- //$R1=query_187_jdxf("show variables like 'collation_%'");
- //print_r($R1);
- $res=query_187_jdxf("show tables");
- print_r($res);
- //$res1=query_187_jdxf("desc example");
- //print_r($res1);
- //$res2=query_187_jdxf("select * from example");
- //print_r($res2);
- //$res3=insert_187_jdxf("mysqldump -u a0313085524 -p RUNOOB example > example.txt");
- ////$res2=insert_187_jdxf("UPDATE example SET content ='' WHERE id=2");
- //print_r($res3);
- ?>
|