Note that there are some explanatory texts on larger screens.

plurals
  1. POphp delete on jQuery doesnt work
    primarykey
    data
    text
    <p>I have a page that updates and delete based on user action edit works fine, but my delete link doesnt work, when ever I click on the delete link it doesnt do anything Plz help me with what Im doing wrong in this code if possible show me where to edit and how...</p> <p>I have two pages for this first is</p> <p><strong>casher.php</strong></p> <pre><code>&lt;?php require_once('../auth.php'); ?&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Silay Institute&lt;/title&gt; &lt;link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" /&gt; &lt;!--sa poip up--&gt; &lt;link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" /&gt; &lt;script src="lib/jquery.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="src/facebox.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox({ loadingImage : 'src/loading.gif', closeImage : 'src/closelabel.png' }) }) &lt;/script&gt; &lt;link rel="stylesheet" href="febe/style.css" type="text/css" media="screen" charset="utf-8"&gt; &lt;script src="argiepolicarpio.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;script src="js/application.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;style&gt; #mainhhh { background: none repeat scroll 0 0 #FFFFFF; border: 8px solid #EEEEEE; border-radius: 5px 5px 5px 5px; box-shadow: 0 0 10px #4E707C; font: 11px "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif; margin: 5em auto; position: relative; text-align: left; width: 1000px; } #mainhhh h1 { background: none repeat scroll 0 0 #0092C8; border-bottom: 1px solid #007DAB; color: #FFFFFF; font-size: 14px; margin: 0; padding: 5px 10px; text-shadow: 0 1px 0 #007DAB; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="mainhhh"&gt; &lt;h1&gt; &lt;a id="addq" href="index.php" title="click to enter homepage" style="background-image:url('../images/out.png'); background-repeat:no-repeat; padding: 3px 12px 12px; margin-right: 10px;"&gt;&lt;/a&gt; &lt;label for="filter"&gt;Filter&lt;/label&gt; &lt;input type="text" name="filter" value="" id="filter" /&gt; &lt;a rel="facebox" href="addcasher.php" id="addq"&gt;Add Casher&lt;/a&gt; &lt;/h1&gt; &lt;table cellpadding="1" cellspacing="1" id="resultTable"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th style="border-left: 1px solid #C1DAD7"&gt; Name &lt;/th&gt; &lt;th&gt;ID Number&lt;/th&gt; &lt;th&gt;Work&lt;/th&gt; &lt;th&gt;Gender&lt;/th&gt; &lt;th&gt;Status&lt;/th&gt; &lt;th&gt;Birthday&lt;/th&gt; &lt;th&gt; Action &lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;?php include('../connect.php'); $result = mysql_query("SELECT * FROM casher"); while($row = mysql_fetch_array($result)) { echo '&lt;tr class="record"&gt;'; echo '&lt;td style="border-left: 1px solid #C1DAD7"&gt;'.$row['fname'].' '.$row['mname'].' '.$row['lname'].'&lt;/td&gt;'; echo '&lt;td&gt;&lt;div align="left"&gt;'.$row['idnumber'].'&lt;/div&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;div align="left"&gt;'.$row['work'].'&lt;/div&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;div align="left"&gt;'.$row['gender'].'&lt;/div&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;div align="left"&gt;'.$row['status'].'&lt;/div&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;div align="left"&gt;'.$row['bday'].'&lt;/div&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;div align="center"&gt;&lt;a rel="facebox" href="editcprofile.php?id='.$row['id'].'" title="Click To Edit"&gt;Edit Profile&lt;/a&gt; | &lt;a href="#" id="'.$row['id'].'" class="delbutton" title="Click To Delete"&gt;delete&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;'; echo '&lt;/tr&gt;'; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;script src="js/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $(".delbutton").click(function(){ //Save the link in a variable called element var element = $(this); //Find the id of the link that was clicked var del_id = element.attr("id"); //Built a url to send var info = 'id=' + del_id; if(confirm("Sure you want to delete this update? There is NO undo!")) { $.ajax({ type: "GET", Data:{id:del_id} url: "deletecasher.php", data: info, success: function(){ } }); $(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast") .animate({ opacity: "hide" }, "slow"); } return false; }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>deletecasher.php</strong></p> <pre><code>&lt;?php // This is a sample code in case you wish to check the username from a mysql db table include('../connect.php'); if($_GET['id'] &amp;&amp; is_int($_GET['id']) { $id = (int) $_GET['id']; $sql = "delete from casher where id='$id'"; mysql_query( $sql); } ?&gt; </code></pre> <p>Any input with sample appreciated</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload