mysql_connect('localhost','root','password');
 mysql_select_db('database_name');
 $query=mysql_query("select count(*) total from table where field='111'");
 $array=mysql_fetch_array($query);
 if($array['total']>0)
 {
  mysql_query('delete from table where field=111');
 }
 else 
 {
  echo '没有';
 }根据自己的东西更改上面的内容