-5
你好,我没有什么问题,这一点:DELETE PHP的MySQL不工作
require_once("dbconnect.php");
mysql_query('set names utf8');
$query = ('DELETE FROM `gallery` WHERE `id` = 16') or die("failed");
它不是从数据库中删除记录。你可以帮我吗?谢谢。 dbconnect.php是正确的。
你'$查询=( 'DEL ...'必须是'$查询=请求mysql_query(' 删除...'也为-1,问题表明不遗余力。 – castis
[Little Bobby](http://bobby-tables.com/)说*** [你的脚本存在SQL注入攻击风险。](http://stackoverflow.com/questions/60174/how-can-i -prevent-sql -injection-in-php)***。甚至[转义字符串](http://stackoverflow.com/questions/5741187/sql-injection-that-gets-around-mysql-real-escape-字符串)是不安全的! –
***请[停止使用'mysql_ *'函数](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php)。 *** [这些扩展](http://php.net/manual/en/migration70.removed-exts-sapis.php)已在PHP 7中删除。了解[prepared](http://en.wikipedia .ORG /维基/ P repared_statement)语句[PDO](http://php.net/manual/en/pdo.prepared-statements.php)和[MySQLi](http://php.net/manual/en/mysqli.quickstart.prepared -statements.php)并考虑使用PDO,[这真的很简单](http://jayblanchard.net/demystifying_php_pdo.html)。 –