title: Get variable from address bar and then delete from MySQL database
body: <p>I have the code below which links to a page called deletepage.php which is in my FTP in the right directory. It adds the variable on the end from a database query, that bit works and it opens the page correctly:</p>
  
  <pre><code>&lt;a href=\"http://themacsplash.com/ClipBoy/deletepage.php?plink=$link&amp;user=$username\"&gt;X&lt;/a&gt;
  </code></pre>
  
  <p>But now I have this code to run a query on that in the MySQL database but it doesn't actually delete it when it should be deleting it:</p>
  
  <pre><code>    $con = mysql_connect("localhost", "will", "blahblah");
  if (!$con) {
    die('Could not connect: '.mysql_error()); //check for database errors
  }
  $username = $_GET['user'];
  mysql_select_db("themacsp_clipboy", $con);
  $sql = ("DELETE * FROM links WHERE link = ".(int)$_GET['plink'] AND username='$username');
  mysql_query($sql);
  header("location: http://themacsplash.com/userfiles/$username");
  ?&gt;
  </code></pre>
  
  <p>I get an error: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '=' in >/data/www/vhosts/themacsplash.com/httpdocs/ClipBoy/deletepage.php on line 10</p>
  </blockquote>
  
  <p>Line 10 is the $sql line (<code>$sql = ("DELETE * FROM links WHERE link = ".(int)$_GET['plink'] AND username='$username');</code>)</p>
  
  <p>How would I fix this?</p>