<?php $con = mysql_connect("localhost","root","") or die("error"); $mysql = mysql_select_db("monkey",$con); $sql = "delete from rote where id <=4"; //$sql = "delete from rote where id=‘".$id."‘"; mysql_query($sql,$con); $row = mysql_affected_rows(); //返回影响行数 echo $row."\n"; if($row > 0){ echo "删除成功"; }else{ echo "删除失败"; } mysql_close(); ?>
时间: 2024-10-06 14:03:22