Inline Add & Delete Data Using PHP

Submitted by: 
Language: 
Visitors have accessed this post 2741 times.

inline add & delete data using php

Add & Save Data To Database Using Inline Add PHP

Creating Database Connection

  1. <?php
  2. $conn = mysqli_connect('localhost', '', 'password', '') or die(mysqli_error());
  3. if(!$conn){
  4. die("Error: Failed to connect to database");
  5. }
  6. ?>

php code to fetch data from database table wise

  1. <?php
  2. require 'conn.php';
  3. $query = mysqli_query($conn, "SELECT * FROM `tc` ORDER BY `reg` ASC") or die(mysqli_error());
  4. while($fetch = mysqli_fetch_array($query)){
  5. ?>
  6.  
  7.  
  8. <tr class="del_mem<?php echo $fetch['mem_id']?>">
  9. <td><?php echo $fetch['reg']?></td>
  10. <td><?php echo $fetch['name']?></td>
  11. <td><?php echo $fetch['fname']?></td>
  12. <td><?php echo $fetch['mname']?></td>
  13. <td><?php echo $fetch['dob']?></td>
  14. <td><button type="button" class="btn btn-danger btn_del" id="<?php echo $fetch['mem_id']?>"><span class="glyphicon glyphicon-remove"></span> Delete TC</button></td>
  15. </tr>
  16. <?php
  17. }
  18. ?>

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Thanks Very nice.No Delete file found and insert query values to be rechecked

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe> [video]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.