> 常用mysql命令标记大全

常用mysql命令标记大全

show processlist;    查看mysql正在运行的进程

---- 显示数据

<?php
    header("Content-Type:text/html;charset=utf-8");//设置页面字符编码
    $conn = mysqli_connect('localhost','xxxx','xxxx');    // 第一步,连接数据库 
    mysqli_select_db($conn,"xxxx"); // 第二步,选择指定的数据库,设置字符集
    mysqli_query($conn,'SET NAMES UTF8');
    $query = 'select * from xxxx order by id ASC limit 10';// 显示数据

    $result = mysqli_query($conn,$query);   
    while(!!$row = mysqli_fetch_array($result)){
        echo"".$row["url"]."";
    }
 
  ?>

----删除数据

  <?php
    $query = 'DELETE FROM xxxx  order by id ASC limit 10';// 显示数据
    $result = mysqli_query($conn,$query); 
    mysqli_close($conn);
  ?>