How to Delete Data From Mysql Database

In this tutorial, we will explain how to Delete Data from Mysql database which is already inserted in the database using PHP.

table.php

<?php
include(db.php);
?>
<html>
<head>
<title>Table</title>
</head>
<body>
<div class="table">
	<div class="tab1"><h1>Name</h1></div>
    <div class="tab1"><h1>Father name</h1></div>
    <div class="tab1"><h1>Mother name</h1></div>
    <div class="tab1"><h1>E-mail</h1></div>
    <div class="tab1"><h1>Address</h1></div>
    <div class="tab1"><h1>DOB</h1></div>
    <div class="tab1"><h1>Category</h1></div>
    <div class="tab1"><h1>Image</h1></div>
    <div class="tab1"><h1>Action</h1></div>
    <div class="tab1"><h1>Delete</h1></div>
    
<?php $query1 = "select * from new order by id desc limit 0,30";
$query2 = mysql_query($query1);
while($row = mysql_fetch_array($query2)) {  ?>
    
    
    <div class="tab1"><h1><?php echo $row['name'];?></h1></div>                                     
    <div class="tab1"><h1><?php echo $row['father_name'];?></h1></div>                                    <!--from database-->
    <div class="tab1"><h1><?php echo $row['mother_name'];?></h1></div>
    <div class="tab1"><h1><?php echo $row['e_mail'];?></h1></div>
    <div class="tab1"><h1><?php echo $row['address'];?></h1></div>
    <div class="tab1"><h1><?php echo $row['dob'];?></h1></div>
    <div class="tab1"><h1><?php echo $row['category'];?></h1></div>
    <div class="tab1"><h1><a href="delete.php?id=<?php //echo $row['id'];?>">Delete</a></h1></div>
    
<?php } ?>
</div>
</body>
</html>

style.css

.table{
height:400px;
width:100%;
float:left;
}

.tab1{
width:9.5%;
height:42px;
border:1px #000000 solid;
float:left;
}
.tab1 h1{
width:70px;
height:20px;
font-size:18px;
float:left;
margin:0px;
padding:0px 30px;
}
.tab1 h2{
width:89.5px;
height:20px;
font-size:18px;
float:left;
margin:0px;
padding:0px 15px;
}

delete.php

<?php 
include(db.php);
$id = $_GET['id'];
 $querydel = "delete from new where id = '$id' ";
mysql_query($querydel);
?>

db.php

<?php 
mysql_connect('localhost', 'root', '');
mysql_select_db('db');
?>

How to Fetch Data From Mysql Database using PHP

31 thoughts on “How to Delete Data From Mysql Database

  • July 26, 2020 at 10:07 pm
    Permalink

    Good post. I learn something new and challenging on websites I stumbleupon everyday.
    It will always be exciting to read through content from other
    authors and use something from other websites.

    Reply
  • July 30, 2020 at 3:02 pm
    Permalink

    This article will help the internet viewers for creating
    new blog or even a blog from start to end.

    Reply
  • July 30, 2020 at 5:16 pm
    Permalink

    Fantastic beat ! I would like to apprentice whilst you amend your website, how can i subscribe for a blog website?

    The account aided me a applicable deal. I have been a little bit familiar of this your broadcast offered bright clear idea

    Reply
  • July 30, 2020 at 5:17 pm
    Permalink

    I am extremely impressed together with your writing skills as neatly as with the format to your blog.

    Is that this a paid topic or did you modify it yourself?
    Anyway keep up the excellent high quality writing, it is rare
    to see a great weblog like this one these days..

    Reply
  • July 30, 2020 at 6:12 pm
    Permalink

    Wow, this piece of writing is fastidious, my sister is analyzing these kinds of things, therefore I am going to inform her.

    Reply
  • July 30, 2020 at 6:24 pm
    Permalink

    My brother recommended I might like this website. He was entirely right.
    This post actually made my day. You can not imagine just
    how much time I had spent for this info! Thanks!

    Reply
  • July 31, 2020 at 12:42 am
    Permalink

    Great article! That is the type of info that should be shared across the internet.
    Disgrace on the seek engines for not positioning this put up upper!
    Come on over and discuss with my site . Thanks =)

    Reply
  • July 31, 2020 at 3:24 am
    Permalink

    I go to see everyday a few web pages and websites to read articles or reviews, but this blog gives quality based articles.

    Reply
  • July 31, 2020 at 9:04 am
    Permalink

    It is not my first time to visit this web site, i am
    browsing this web site dailly and get fastidious data from here all the time.

    Reply
  • July 31, 2020 at 12:26 pm
    Permalink

    I seriously love your website.. Great colors & theme. Did you build
    this web site yourself? Please reply back as I’m planning to create my very own blog and want to learn where you got this from or just what the theme is called.
    Cheers!

    Reply
    • August 1, 2020 at 1:27 am
      Permalink

      Hello Situs Slot termurah,

      Yes i designed this website. If you contact me please click on this Link

      Reply
  • July 31, 2020 at 9:10 pm
    Permalink

    Does your site have a contact page? I’m having a tough time locating it but, I’d like to send you an email.

    I’ve got some ideas for your blog you might be interested in hearing.
    Either way, great website and I look forward to seeing it develop over time.

    Reply
    • August 1, 2020 at 1:25 am
      Permalink

      you can Contact Us by this link

      Reply
  • August 1, 2020 at 3:13 am
    Permalink

    It is the best time to make some plans for the future and it is time to be happy.
    I’ve learn this put up and if I may just I desire to suggest you
    some interesting things or tips. Perhaps you could write next articles regarding this article.
    I want to learn even more issues approximately it!

    Reply
  • August 1, 2020 at 3:36 am
    Permalink

    Hello There. I found your blog using msn. This is a really well written article.

    I will be sure to bookmark it and return to read more of your
    useful information. Thanks for the post. I’ll certainly return.

    Reply
  • August 1, 2020 at 6:24 am
    Permalink

    Awesome website you have here but I was curious if you knew of any discussion boards that cover the same topics
    talked about here? I’d really like to be a part of group
    where I can get feedback from other knowledgeable individuals that share the same interest.

    If you have any recommendations, please let me know. Thank you!

    Reply
  • August 1, 2020 at 9:49 am
    Permalink

    Hello, i think that i saw you visited my web site thus i got
    here to return the favor?.I am trying to in finding things to improve my website!I guess its good enough to make use of some of your
    ideas!!

    Reply
  • August 1, 2020 at 1:36 pm
    Permalink

    Heya i am for the primary time here. I came across this board and I find
    It truly useful & it helped me out much. I hope to offer something
    back and aid others such as you aided me.

    Reply
  • August 2, 2020 at 11:13 am
    Permalink

    I think that what you said was actually very logical.
    But, consider this, what if you added a little content?
    I mean, I don’t want to tell you how to run your blog, but what if you added a title to possibly get folk’s attention?
    I mean How to Delete Data From Mysql Database – Hub of Tutorials is a little vanilla.

    You ought to glance at Yahoo’s home page and watch how they
    write article titles to grab people to open the links.
    You might add a video or a related picture or two to grab
    readers excited about everything’ve got to say.
    Just my opinion, it might make your posts a little livelier.

    Reply
  • August 2, 2020 at 12:49 pm
    Permalink

    This is very fascinating, You are a very professional
    blogger. I have joined your rss feed and stay up for in search of
    more of your wonderful post. Also, I have shared your site in my social
    networks

    Reply
  • August 3, 2020 at 10:07 am
    Permalink

    Why people still make use of to read news papers when in this
    technological globe everything is existing on web?

    Reply
  • August 3, 2020 at 12:32 pm
    Permalink

    When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time
    a comment is added I get three e-mails with the same comment.
    Is there any way you can remove people from that service?

    Bless you!

    Reply
  • August 4, 2020 at 12:55 pm
    Permalink

    Hey there! I could have sworn I’ve been to this website before but after browsing through some of the post I realized it’s
    new to me. Anyhow, I’m definitely delighted I found it and I’ll be bookmarking and checking back frequently!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *