【PHP MYSQL_QUERY删除不了数据】如题
Jun 23, 2016 pm 01:38 PM 这是代码
/**
* 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 "<script>alert('删除成功!')</script>";
echo "<script>"; <br /> echo "window.location.href='$url'"; <br /> echo "</script>";
}
else
{
echo "<script>alert('删除失败1!')</script>";
echo "<script>"; <br /> echo "window.location.href='$url'"; <br /> echo "</script>";
}
}
else
{
echo "<script>alert('删除失败2!')</script>";
echo "<script>"; <br /> echo "window.location.href='$url'"; <br /> echo "</script>";
}
?>
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'");

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon
