<?php $link = mysqli_connect('localhost','root','123456'); if (mysqli_connect_errno($link)>0) { echo mysqli_connect_error($link);exit; } mysqli_select_db($link,'ss34'); mysqli_set_charset($link,'utf8'); //$sql="UPDATE info SET name='恐龙先生',city='英国' WHERE id=22"; $sql="DELETE FROM info WHERE id=23"; //echo $sql;exit; $result = mysqli_query($link,$sql); if($result && mysqli_affected_rows($link)>0){ //echo '修改成功'; echo '删除成功'; }else{ //echo '修改失败'; echo '删除失败'; } mysqli_close($link);
点击 "运行实例" 按钮查看在线实例