【PHP MYSQL_QUERY删除不了数据】如题
程序员文章站
2022-06-13 09:11:19
...
这是代码
/**
* Created by PhpStorm.
* User: mdf
* Date: 2015/3/18
* Time: 13:59
*/
$id=$_REQUEST['id'];
$delreply="Delete from tb_blog_reply where Blog_id=".$id;
$delblog="Delete from tb_blog_information where Blog_id=".$id;
$DelR=mysql_query($delreply);
$DelB=mysql_query($delblog);
echo $delreply;
echo $delblog;
$url="http://localhost/Myhome/Contorl.php";
if($DelR)
{
$DelB=mysql_query($delblog);
if($DelB){
echo "";
echo "";
}
else
{
echo "";
echo "";
}
}
else
{
echo "";
echo "";
}
?>
SQL语句打印出来都是能在数据库删除的,可是运行mysql_query却不能删掉,
/**
* Created by PhpStorm.
* User: mdf
* Date: 2015/3/18
* Time: 13:59
*/
$id=$_REQUEST['id'];
$delreply="Delete from tb_blog_reply where Blog_id=".$id;
$delblog="Delete from tb_blog_information where Blog_id=".$id;
$DelR=mysql_query($delreply);
$DelB=mysql_query($delblog);
echo $delreply;
echo $delblog;
$url="http://localhost/Myhome/Contorl.php";
if($DelR)
{
$DelB=mysql_query($delblog);
if($DelB){
echo "";
echo "";
}
else
{
echo "";
echo "";
}
}
else
{
echo "";
echo "";
}
?>
SQL语句打印出来都是能在数据库删除的,可是运行mysql_query却不能删掉,
回复讨论(解决方案)
没有看到连接数据库的代码
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('Cound not connect the db!!'.mysql_error());
}
mysql_select_db("the_blog");
mysql_query("set names 'utf8'");
上一篇: 有关有活力的文章推荐9篇