"PHP mysql_query cannot delete data" title

Source: Internet
Author: User
This is the code
/**
* 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 statements can be printed out in the database deleted, but run mysql_query can not be deleted,


Reply to discussion (solution)

You do not see the code to connect to the database

$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 '");

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.