HUB OF TUTORIALS
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
HUB OF TUTORIALS
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
HUB OF TUTORIALS
  • Business
  • Digital Marketing
  • Technology
    • HTML
    • CSS
    • jQuery
    • WordPress
    • Core PHP
    • Mysql
    • JAVA
    • Projects
    • Photography
  • Recipes
  • Others
  • Write for Us
Core PHPMysql

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

delete all data from table mysql delete query in mysql php How to Delete Data From Mysql Database how to delete row in mysql using php mysqli delete join mysqli update
How to Update Data into Database using PHPPrevHow to Update Data into Database using PHPMarch 17, 2020
How to Fetch Data From Mysql Database using PHPMarch 17, 2020How to Fetch Data From Mysql Database using PHPNext

Comments (38)

  1. how to unclog a kitchen sink
    August 25, 2020

    whoah this blog is fantastic i really like reading your articles.
    Keep up the great work! You know, a lot of individuals are searching round for
    this info, you could help them greatly.

  2. 해외에이전시
    August 24, 2020

    Hi, I do believe this is a great web site. I stumbled upon it 😉
    I may revisit once again since I have bookmarked it.

  3. http://heavylathemachinejobwork79011.bloginwi.com/20306700/top-heavy-machine-operator-secrets
    August 24, 2020

    Hey I am so excited I found your weblog, I really found
    you by error, while I was browsing on Bing for something else, Anyways I am here now and
    would just like to say thanks a lot for an incredible post and an all
    round exciting blog (I also love the theme/design), I don’t have time to go through
    it all at the moment but I have bookmarked
    it and also added in your RSS feeds, so when I have time
    I will be back to read a lot more, Please do keep up the fantastic job.

  4. apprendre la photo
    August 23, 2020

    I believe that is among the such a lot significant information for me.

    And I am happy to read your article. However, want to
    remark on few basic things, The web site taste is great, the articles are truly great : D.
    Just right job, cheers

  5. cool soccer moves that are easy to learn
    August 23, 2020

    Hello, the whole thing is going well here and ofcourse every one is sharing facts, that’s
    really excellent, keep up writing.

  6. công ty tư vấn định cư glfin
    August 23, 2020

    Thank you, I have recently been searching for info approximately this subject for a long
    time and yours is the greatest I have found out till now.
    However, what in regards to the bottom line? Are you certain about the supply?

  7. avertizori pescuit
    August 23, 2020

    I was recommended this web site by means of
    my cousin. I am not positive whether or not this post is written through him as nobody
    else recognise such exact about my trouble. You are amazing!
    Thanks!

  8. pet friendly apartments memphis tn
    August 23, 2020

    Hello. excellent job. I did not imagine this.
    This is a remarkable story. Thanks!

  9. led display
    August 23, 2020

    I need to to thank you for this wonderful read!! I certainly enjoyed
    every little bit of it. I’ve got you bookmarked to check out
    new stuff you post…

  10. Hai San Mr D 0938.452.752
    August 23, 2020

    Thanks for the marvelous posting! I actually enjoyed reading it, you happen to be a great author.I will make certain to
    bookmark your blog and definitely will come back at some point.
    I want to encourage that you continue your great writing, have a nice morning!

  11. classinzoom.com
    August 23, 2020

    Thank you for the good writeup. It in fact was a amusement account it.

    Look advanced to far added agreeable from you! However, how could we communicate?

  12. 3 inch Composite Deck
    August 23, 2020

    Hey there! This is kind of off topic but I need some advice from an established blog.
    Is it hard to set up your own blog? I’m not very techincal but I can figure things out pretty fast.

    I’m thinking about setting up my own but I’m not sure where to begin. Do you have any ideas or suggestions?
    Many thanks https://keystarindustries.com/3-composite-deck-keystar-industries/

  13. family fun in orlando
    August 22, 2020

    Just wish to say your article is as surprising. The clarity in your post is just spectacular and i can assume you
    are an expert on this subject. Well with your permission let me to grab your RSS feed to keep up to date with forthcoming post.

    Thanks a million and please carry on the rewarding work.

  14. fun games for 9 year old boys
    August 22, 2020

    Wow, this piece of writing is nice, my younger sister is analyzing these things, thus I am going to convey her.

  15. golf balls
    August 22, 2020

    Hello, i feel that i saw you visited my blog so i got
    here to go back the choose?.I am trying to find things to improve my site!I suppose its ok to make use of a few
    of your ideas!! https://mycustomgolfball.com/157-golf-balls

  16. SXHP
    August 22, 2020

    Keep on working, great job!

  17. foundation repair
    August 21, 2020

    Very soon this site will be famous amid all blogging
    viewers, due to it’s fastidious content

  18. back
    August 21, 2020

    Do you mind if I quote a few of your articles
    as long as I provide credit and sources back to your blog?
    My blog is in the very same niche as yours and my users would definitely benefit from a lot of the
    information you present here. Please let me know if this ok with you.
    Many thanks!

  19. money
    August 21, 2020

    Please let me know if you’re looking for a article writer for your
    blog. You have some really good articles and I feel I would be a good asset.

    If you ever want to take some of the load off, I’d love to write some content for your blog in exchange for a
    link back to mine. Please shoot me an e-mail if interested.
    Cheers!

  20. http://inpris.net
    August 21, 2020

    Amazing! Its actually remarkable article, I have got much clear idea on the topic of from this article.

  21. fun things to do in minneapolis this weekend
    August 18, 2020

    I absolutely love your blog and find many of your post’s to be just what
    I’m looking for. Would you offer guest writers to write content for you?
    I wouldn’t mind composing a post or elaborating on a number of
    the subjects you write with regards to here. Again, awesome web site!

  22. foundation repair
    August 18, 2020

    I love it when individuals come together and share ideas.

    Great blog, continue the good work!

  23. Sandra
    August 16, 2020

    I got this site from my friend who shared with me about this site
    and now this time I am browsing this web page and reading very informative articles at this place.

  24. đánh giá nhà cái
    August 16, 2020

    Wonderful, what a web site it is! This web site presents valuable data to us, keep it up.

  25. https://www.google.com/maps/d/edit?mid=1HwR6AJrb1QOHrtZhqX5Z-If0G-c1_qvK&usp=sharing
    August 16, 2020

    Hello would you mind letting me know which hosting company you’re using?
    I’ve loaded your blog in 3 completely different internet browsers and
    I must say this blog loads a lot faster then most. Can you recommend
    a good internet hosting provider at a honest price?
    Cheers, I appreciate it!

  26. joker388
    August 16, 2020

    whoah this blog is wonderful i like studying your posts.
    Stay up the great work! You know, lots of people are
    looking round for this info, you could help them
    greatly.

  27. https://rb.gy/k2bsu4
    August 15, 2020

    Les stratégies de transformation digitale.

  28. www.tantrictop.co.uk
    August 14, 2020

    Pretty section of content. I just stumbled upon your blog and in accession capital to assert that I get in fact enjoyed account your blog posts.
    Any way I will be subscribing to your augment and even I achievement you access consistently rapidly.

  29. googl
    August 12, 2020

    Thanks for the marvelous posting! I actually enjoyed reading it, you happen to be a great
    author.I will be sure to bookmark your blog and will often come back down the road.
    I want to encourage continue your great posts, have a
    nice morning!

  30. Lynne
    August 11, 2020

    Yes! Finally someone writes about youtube vidos rosa
    lopes de operacion triumfo unchained melody.

  31. royalrahul007
    August 10, 2020

    If You want to contact us Click here

  32. Central IT
    August 9, 2020

    Appreciating the commitment you put into your blog and in depth
    information you provide. It’s nice to come across a blog every once in a while that isn’t
    the same unwanted rehashed material. Excellent read!
    I’ve bookmarked your site and I’m including your RSS feeds to
    my Google account.

  33. 일본서버호스팅
    August 9, 2020

    Thank you for the good writeup. It in reality used to be a leisure account it.

    Glance complex to far delivered agreeable from you!

    However, how can we keep in touch?

  34. 일본서버호스팅
    August 8, 2020

    Greetings from Carolina! I’m bored to tears at work so I decided to
    browse your site on my iphone during lunch break. I love the info you present here and can’t
    wait to take a look when I get home. I’m surprised at how quick your blog loaded on my
    phone .. I’m not even using WIFI, just 3G ..

    Anyhow, fantastic blog!

  35. เล่นสล็อตฟรี
    August 6, 2020

    This paragraph offers clear idea for the new viewers of blogging, that really how to do blogging.

  36. royalrahul007
    August 1, 2020

    you can Contact Us by this link

  37. 다이어트 도시락
    July 31, 2020

    It’s amazing designed for me to have a site,
    which is useful in favor of my experience. thanks admin

  38. Pembesar Payudara
    July 30, 2020

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

Search
Recent Posts
  • 7 Educational Approaches for Diverse Learners
  • 5 Best Online Payment Gateways in India
  • How to Start and Earn from Making WooCommerce Plugins
  • Step By Step Guide to Becoming a Certified Salesforce Developer
  • A Guide to Transitioning from On-Premises to Azure Services
Categories
  • Business
  • Core PHP
  • CSS
  • Digital Marketing
  • HTML
  • JAVA
  • Jobs
  • jQuery
  • Mysql
  • News
  • Others
  • Photography
  • Projects
  • Recipes
  • WordPress

  • How to Create List in HTML
  • How to use Iframe in HTML
  • How to Create a Table in HTML and CSS
  • How to Add New HTML Content using jQuery
  • CSS Property of List tag in HTML
  • How to use CSS for Table in HTML
  • How to Make Basmati Rice Recipe
  • How to Make Indian Kheer Recipe
  • How to Make Spicy Aloo Tikki
  • How to Make Aloo Matar Samosa
  • How to Make Cheese Potato Sandwich
  • How to Make Aloo Palak Methi
  • Company Visitors Management System
  • Complaint Management System using PHP
  • Directory Management System
  • Employee Record Management System
  • Hospital Management System using PHP
  • Vehicle Parking Management System

Copyright © 2022 Hub of Tutorials. All Rights Reserved. Designed by AS Webworks