删除MySQL的问题 [英] DELETE problem with MySQL

查看:56
本文介绍了删除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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆