title: MYSQL - Get Next and Previous Record by ID - HTML for hyperlinks
body: <p>So I'm trying to add a little bit of convenience to a CRUD by adding next and previous links to navigate between records in my database.</p>
  
  <p><strong>Here are my queries:</strong></p>
  
  <pre><code>$id=$_GET['id'];
  $id = $currentid;
  $prevquery= "SELECT * FROM inventory WHERE id &lt; $currentid ORDER BY id DESC LIMIT 1"; 
  $prevresult = mysql_query($prevquery);
  
  $nextquery= "SELECT * FROM inventory WHERE id &gt; $currentid ORDER BY id ASC LIMIT 1"; 
  $nextresult = mysql_query($nextquery);
  ?&gt;
  </code></pre>
  
  <p><strong>Here is my HTML:</strong></p>
  
  <pre><code>&lt;a href="http://www.url.com/crud/edit.php?id=&lt;?php echo $prevresult; ?&gt; "&gt;Previous&lt;/a&gt;
  
  &lt;a href="http://www.url.com/crud/edit.php?id=&lt;?php echo $nextresult; ?&gt; "&gt;Next&lt;/a&gt;
  </code></pre>
  
  <p>Now I tested these queries in PHPMyAdmin and they produced the result I wanted, but I can't get my hyperlinks to actually be supplied with the correct IDs... they're just blank after the =. What am I doing wrong?</p>