如何删除表中的行

时间:2012-04-30 05:05:23

标签: php sql

如何使用PHP和MYSQL删除表中的行? with account_name,maintenance_type,ma_status,ma_contract_start,ma_contract_end,ma_reference_no

3 个答案:

答案 0 :(得分:2)

DELETE FROM a_table WHERE account_name="someaccountname" AND maintenance_type="whatever"   etc...

答案 1 :(得分:0)

听起来你在这里寻找教程看看这个

http://w3schools.com/php/php_mysql_delete.asp

答案 2 :(得分:0)

你可以像这样使用它:

<?php
$con = mysql_connect("localhost","username","password");
if (!$con) {
  die('Could not connect: ' . mysql_error());
}

mysql_select_db("my_db", $con);

mysql_query("DELETE FROM account_name WHERE SomeField='value'");

mysql_close($con);
?>