根据行值删除特定日志

时间:2015-03-22 06:56:38

标签: php mysql

这适用于客户端管理Web面板。所以我的结构看起来像这样:     表:剪贴板     行:机器名称     行:窗口标题     行:剪贴板文本     行:机器时间     行:IP地址

我在php中建立连接

include ('config.php');
$table = "Clipboard";
$conn = mysqli_connect($mysql_host, $mysql_user, $mysql_password,$mysql_database);

我需要能够将条目删除到我的数据库中,具体取决于"机器是什么"。因此,如果机器名称是" Ben"我需要通过" Ben"被删除。因此,如果Machine Name = Ben,我需要删除该条目的所有相应行。

最快捷,最有效的方式是什么?

include ('config.php');
$connection = mysql_connect($mysql_host, $mysql_user, $mysql_password);
$db = mysql_select_db($mysql_database, $connection);
$machinename = $_POST['machinename'];
$safemachinename = mysql_real_escape_string($machinename);
$query = mysql_query("delete from Notification where machinename=$safemachinename", $connection);

0 个答案:

没有答案
相关问题