我创建了一个名为的页面 delete.php
使用以下代码
<?php
require_once("database.php");
$con = mysql_connect($config["db_server"],$config["db_user"],$config["db_pass"]);
mysql_select_db($config['db_name'], $con);
// The SQL statement that deletes the record
$strSQL = "DELETE FROM records WHERE record_id = 1";
mysql_query($strSQL);
// Close the database connection
mysql_close();
?>
Run Code Online (Sandbox Code Playgroud)
现在,如果我转到http://www.domain.com/delete.php
哪个将删除表记录中的1的记录ID.
我如何使用php字符串,所以当我去http://www.domain.com/delete.php?del?=25
删除它record_id 25?
谢谢.