PHP / SQL Query dynamic record from url
<p>I currently have this:</p>

<pre><code>&lt;?php
  $con = mysql_connect('localhost', 'root', 'dev');
  if(!$con) {
    die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("myDB");
  $query = "SELECT * FROM pages where id=1";
  $result = mysql_query($query);
  $row = mysql_fetch_assoc($result);
  $contents = $row['content'];
  echo $contents;
?&gt;
</code></pre>

<p>See this part: <code>SELECT * FROM pages where id=1</code></p>

<p>1 is the record id and it's currently hardcoded. What I need to do is change it so it get's the record id from the url...for example: mysite.com/index.php?2 would show record id 2 ... </p>

<p>How do I go about doing this?</p>
