phpinfo.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. //phpinfo();
  3. ////连接本地的 Redis 服务
  4. //$redis = new Redis();
  5. //$res=$redis->connect('47.98.201.73', 6379);
  6. //echo $res;
  7. //echo "Connection to server successfully";
  8. ////查看服务是否运行
  9. //echo "Server is running: " . $redis->ping();
  10. header("Content-type:text/html;charset=utf-8");
  11. function query_187_jdxf($sql){
  12. $link = mysqli_connect('localhost', 'a0313085524', '1f84d01e', 'a0313085524', 3306);
  13. mysqli_query($link,"set character set 'utf8'");
  14. $res1 = mysqli_query($link,$sql);
  15. if($res1==FALSE){
  16. return $list=null;
  17. }
  18. $list=array();
  19. while ($row = $res1->fetch_assoc()) {
  20. $list[]=$row;
  21. }
  22. mysqli_free_result($res1);
  23. mysqli_close($link);
  24. return $list;
  25. }
  26. function insert_187_jdxf($sql){
  27. $link = mysqli_connect('localhost', 'a0313085524', '1f84d01e', 'a0313085524', 3306);
  28. mysqli_query($link,"set character set 'utf8'");
  29. $res1 = mysqli_query($link,$sql);
  30. mysqli_close($link);
  31. return $res1;
  32. }
  33. $R=query_187_jdxf("show databases");
  34. print_r($R);
  35. //$R1=query_187_jdxf("show variables like 'collation_%'");
  36. //print_r($R1);
  37. $res=query_187_jdxf("show tables");
  38. print_r($res);
  39. //$res1=query_187_jdxf("desc example");
  40. //print_r($res1);
  41. //$res2=query_187_jdxf("select * from example");
  42. //print_r($res2);
  43. //$res3=insert_187_jdxf("mysqldump -u a0313085524 -p RUNOOB example > example.txt");
  44. ////$res2=insert_187_jdxf("UPDATE example SET content ='' WHERE id=2");
  45. //print_r($res3);
  46. ?>