title: Undefined variable Call Stack #TimeMemoryFunctionLocation 10.0006379256
body: <p>Good day!
  I am having this problem on the update part of my code. Whenever I click my button for update, it gives me this error: Undefined variable Call Stack #TimeMemoryFunctionLocation 10.0006379256 . What did error did I made? Please I need your help.
  Here is my code: </p>
  
  <pre><code>    &lt;?php
      session_start();
      include_once "../styles/header-menu-out.php"; 
      include "dbconnection.php";
  
      function __autoload($class){
      include_once("../main/".$class.".php");}
      $code = new codex("localhost","library_books","root","" );
      $books = $code-&gt;showData("book_info");
      $id = $_REQUEST['update'];
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;&lt;link rel="stylesheet" type="text/css" href="../styles/library_style.css"&gt;&lt;/head&gt;
  &lt;title&gt;Book-A-Holic: Update an Item&lt;/title&gt;
  &lt;body&gt;
      &lt;table&gt;
      &lt;?php foreach ($books as $book){ ?&gt;
          &lt;tr&gt;&lt;td&gt;&lt;input type="Hidden" name="id" value="&lt;?php echo $id; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Title&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="title" value="&lt;?php echo $title; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Author&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="author" value="&lt;?php echo $author; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;ISBN&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="isbn" value="&lt;?php echo $isbn; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Publisher&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="publisher" value="&lt;?php echo $publisher; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Language&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="language" value="&lt;?php echo $language; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Genre&lt;/td&gt;
              &lt;td&gt;&lt;select name="genre"&gt;
                          &lt;option value="&lt;?php echo $genre; ?&gt;"&gt;&lt;?php echo $genre; ?&gt;&lt;/option&gt;
                          &lt;option value="Non-Fiction"&gt;Non-Fiction&lt;/option&gt;
                          &lt;option value="Fiction"&gt;Fiction&lt;/option&gt;
                          &lt;option value="Educational"&gt;Educational&lt;/option&gt;
                          &lt;option value="Reserved"&gt;Reserved&lt;/option&gt;
                          &lt;option value="Instructional Materials"&gt;Instructional Materials&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Quantity&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="quantity" value="&lt;?php echo $quantity; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Availability&lt;/td&gt;
              &lt;td&gt;&lt;select name="availability"&gt;
                          &lt;option value="&lt;?php echo $availability; ?&gt;"&gt;&lt;/option&gt;
                          &lt;option value="Available"&gt;Yes&lt;/option&gt;
                          &lt;option value="N/A"&gt;No&lt;/option&gt;
                      &lt;/select&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Queue&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="queue" value="&lt;?php echo $queue; ?&gt;"/&gt;&lt;/td&gt;&lt;/tr&gt;     
  
      &lt;?php } ?&gt;
  
      &lt;tr&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;
          &lt;button class="mybutton"&gt;&lt;a href="bookUpdate.php?update=&lt;?php echo urlencode($id); ?&gt;"&gt;Update&lt;/a&gt;&lt;/button&gt;
          &lt;button class="mybutton"&gt;&lt;a href="bookDeleteUI.php"&gt;Cancel&lt;/a&gt;&lt;/button&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my oop code: </p>
  
  <pre><code>    public function updateData($id, $title, $author, $isbn, $publisher, $language, $genre, $quantity, $queue, $availability, $table)
  {
      $q = "UPDATE $table SET title = '$title', author = '$author', isbn = '$isbn', publisher = '$publisher',language = '$language', genre = '$genre', quantity = '$quantity', availability = '$availability', queue = '$queue' WHERE id ='$id'";
      $stmt = $this-&gt;con-&gt;prepare($q);
      $stmt-&gt;execute(array(':title'=&gt;$title,':author'=&gt;$author,':isbn'=&gt;$isbn,':publisher'=&gt;$publisher,':language'=&gt;$language, ':genre'=&gt;$genre,':quantity'=&gt;$quantity,':availability'=&gt;$availability,':queue'=&gt;$queue));
      return true;
  }
  </code></pre>
  
  <p>thanks in advance.</p>