title: delete button is not working
body: <p>I am going to delete the particular row of my database, but when i delete the button it tells me that undefined display in deletebookajax.php on line no 54..
  So can u please tell me where i have gone wrong...
  here is my code
  book.php is for displaying the entire book details....</p>
  
  <pre><code>&lt;?php
  include('assets/page_header.php');
  include('db/db.php');
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;&lt;/title&gt;
  &lt;style&gt;
  h1 {
  text-align:center;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;h1&gt;BOOKS PAGE&lt;/h1&gt;
  
  
  
  &lt;?php
  error_reporting(0);
  
  $str="select * from books";
  
  $query1=mysql_query($str);
  
  $q=mysql_num_rows($query1);
  
  //$query2=mysql_query("select status from bookrentalinfo where bookid=$bookid");
  //echo $query2;
  //$res=mysql_fetch_array($query2);
  echo "&lt;table align='center'&gt;";
  echo "&lt;tr&gt;&lt;th&gt;BookID&lt;/th&gt;&lt;th&gt;Title&lt;/th&gt;&lt;th&gt;Author&lt;/th&gt;&lt;th&gt;Publisher&lt;/th&gt;&lt;th&gt;Numcopies&lt;/th&gt;&lt;th&gt;Shelfno&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th colspan=2  &gt;Action&lt;/th&gt;&lt;/tr&gt;";
  while($rows=mysql_fetch_array($query1))
  {
  
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;".$rows['bookid']."&lt;/td&gt;";
  echo "&lt;td&gt;".$rows['title']."&lt;/td&gt;";
  echo "&lt;td&gt;".$rows['author']."&lt;/td&gt;";
  echo "&lt;td&gt;".$rows['publisher']."&lt;/td&gt;";
  echo "&lt;td&gt;".$rows['numcopies']."&lt;/td&gt;";
  echo "&lt;td&gt;".$rows['shelfno']."&lt;/td&gt;";
  echo "&lt;td&gt;".$rows['status']."&lt;/td&gt;";
  echo "&lt;td&gt;&lt;button class='button1' data-toggle='tooltip' title='Delete' id=".$rows['bookid']." value='delete' name='delete'&gt;&lt;img id='image' src='./images/trash.png'/&gt;&lt;/button&gt;&lt;/td&gt;";
  echo "&lt;td&gt;&lt;a id='colour' class='tooltip' href='edit1form.php?book_id=".$rows['bookid']."'&gt;&lt;img id='image' src='./images/small.gif'/&gt;&lt;span class='tooltiptext' &gt;Edit&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
  echo "&lt;/table&gt;";
  ?&gt;
  &lt;div id="display"&gt;
  &lt;/div&gt;
  
  
  
  &lt;!--echo "&lt;td&gt;&lt;button type='button'&gt;delete&lt;/button&gt;&lt;/td&gt;";
  /*if($res['status']=="BORROWED")
  {
  echo "Sorry You Can't Delete The Book";
  }
  else
  {
  echo "The Row Is Deleted";
  }*/--&gt;
  
  
  
  
  &lt;script type="text/javascript"&gt;
  
  $('document').ready(function() {
  
      $(".button1").click(function(e) {
  
       $('[data-toggle="tooltip"]').tooltip(); 
   var strconfirm = confirm("Are you sure you want to delete?");
  if(strconfirm)
  { 
      var bookid=$(this).attr("id");
      alert(bookid);
  
  
  
  
  
      dataString='book_id='+bookid;
      alert(dataString);
  
  
  
              // AJAX Code To Submit Form.
              $.ajax({
              type: "GET",
              url: "db/deletebookajax.php",
              data: dataString,
              cache: false,
              success: function(result){
              alert("submitted"+result);
              $('#display').html(result);
              window.location.href="books.php";
              },
              error: function (xhr, ajaxOptions, thrownError) {
                      alert(xhr.status);
                      alert(thrownError);
              }
              });
  
  
  
      }
      else {
      return false;
      }
          });
  
          });
          &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>deletebookajax.php</p>
  
  <pre><code>&lt;?php
  if(isset($_GET['book_id']))
  {
      $bookid = $_GET['book_id'];
      echo $bookid;
  }
  include('../assets/page_header.php');
  ?&gt;
  
  
  &lt;input type="hidden" name="bookid"  value=&lt;?php if(isset($bookid)) echo $bookid; ?&gt;&gt;
  
  
  
  
  
  &lt;?php
  include('db.php');
  
  //if(isset($_POST['bookid']))
  //
  //$bookid=mysql_real_escape_string($_POST['bookid']);
  $delete = "delete from books WHERE bookid=$bookid";
  
  $query1=mysql_query($delete);
  echo $query1;
  
  if($query1)
  {
  $q=mysql_query("select * from books");
  echo $q;
  $display="&lt;table&gt;";
  $display.="&lt;tr&gt;&lt;th&gt;BookID&lt;/th&gt;&lt;th&gt;Title&lt;/th&gt;&lt;th&gt;Author&lt;/th&gt;&lt;th&gt;Publisher&lt;/th&gt;&lt;th&gt;numcopies&lt;/th&gt;&lt;th&gt;shelfno&lt;/th&gt;&lt;th&gt;status&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;";
  
  while($row=mysql_fetch_array($q))
  {
  $display.="&lt;tr&gt;";
  $display.= "&lt;td&gt;".$row['bookid']."&lt;/td&gt;";
  $display.= "&lt;td&gt;".$row['title']."&lt;/td&gt;";
  $display.= "&lt;td&gt;".$row['author']."&lt;/td&gt;";
  $display.= "&lt;td&gt;".$row['publisher']."&lt;/td&gt;";
  $display.="&lt;td&gt;".$row['numcopies']."&lt;/td&gt;";
  $display.="&lt;td&gt;".$row['shelfno']."&lt;/td&gt;";
  $display.="&lt;td&gt;".$row['status']."&lt;/td&gt;";
  $display.= "&lt;/tr&gt;";
  }
  $display.="&lt;/table&gt;";
  
  }
  
  
  else
  {
  $display.= "U can't delete The book";
  }
  //echo "nothing";
  
  echo $display;
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>