title: Update mysql record using php not working
body: <p>I know the code is messy and very imperfect. However when trying to update a mysql record using the following code below, which I updated. Now it wont post into mysql database</p>
  
  <p>Thanks for your help in advance</p>
  
  <pre><code>&lt;?php
  define('DB_NAME', 'comics');
     define('DB_USER', 'root');
     define('DB_PASSWORD', '');
     define('DB_HOST', 'localhost');
  
     $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
  
     if (!link) {
      die('Could not connect: ' . mysql_error());
     }
  
     $db_selected = mysql_select_db(DB_NAME, $link);
  
     if (!$db_selected) {
      die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
  }
  
  if (!isset($_GET['update'])){
          $q = "SELECT * FROM comics where ID = '$_GET[id]'";
          $result = mysql_query($q);
          $comics = mysql_fetch_array($result);
      }
  
  if(isset($_GET['update']))
  {
  
  
      $email = mysql_real_escape_string($_GET["email"]);
      $title = mysql_real_escape_string($_GET["title"]);
      $issue = mysql_real_escape_string($_GET["issue"]);
      $edition = mysql_real_escape_string($_GET["edition"]);
      $publisher = mysql_real_escape_string($_GET["publisher"]);
      $condition = mysql_real_escape_string($_GET["condition"]);
      $price = mysql_real_escape_string($_GET["price"]);
  
      $targetid = intval($_GET["id"]);
  
      $sql =  "UPDATE comics SET Email='$email', Title='$title',     Issue='$issue', Edition='$edition', Publisher='$publisher',     Quality='$condition', Cost='$price' WHERE ID = '$targetid' ";
  
  $myData = mysql_query($sql,$link);
  if(!$myData) {die(mysql_error());}
  
  if ($myData == TRUE) {
  header('Location: index.html');
  exit();
      }
  }
  </code></pre>