删除MySQL的问题 [英] DELETE problem with MySQL
问题描述
我一直在学习使用PHP和MySQL的教程
freewebmasterhelp.com。一切正常,除了删除东西。
使用这样的URL调用脚本:
http://www.example.org/test/delete_entry.php?id=35
>
这里是脚本:
< ;?
include(dbinfo.inc.php);
$ id = $ _POST [''id''];
mysql_connect($ server,$ user,$ password);
$ query =" DELETE FROM test1 WHERE id =''$ id''" ;;
@mysql_select_db($ database)或die(无法选择数据库。); < br $>
mysql_query($ query);
mysql_close();
header(" Location:entries.php");
?>
dbinfo.inc.php文件定义变量$ server,$ database,$ user
和$密码。登录部分有效。
Gustaf
id =
< blockquote> _POST [''id''];
mysql_connect(
server,
I''ve been learning using PHP and MySQL from the tutorial at
freewebmasterhelp.com. Everything works fine, except deleting things.
The script is invoked with a URL like this:
http://www.example.org/test/delete_entry.php?id=35
And here''s the script:
<?
include("dbinfo.inc.php");
$id = $_POST[''id''];
mysql_connect($server, $user, $password);
$query = "DELETE FROM test1 WHERE id = ''$id''";
@mysql_select_db($database) or die("Unable to select database.");
mysql_query($query);
mysql_close();
header("Location: entries.php");
?>
The dbinfo.inc.php file defines the variables $server, $database, $user
and $password. The login part works.
Gustaf
id =
_POST[''id''];
mysql_connect(
server,
这篇关于删除MySQL的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!