title: pass variable from href to another php page
body: <p>.I have this code:</p>
  
  <pre><code>&lt;a id="various3" href="picture.php?id=',$pid,'" title="'.$info.'"&gt;&lt;img src="picture.php?id=',$pid,'" width="150" height="210"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>it passes the id to my picture.php where i use it on a query string. </p>
  
  <pre><code>$sql = sprintf("select pics, ext from `06-07` where id='%d'",$_GET['id']);
  </code></pre>
  
  <p>Is it possible to pass more than one variable using this method? because i would like to pass "dept" along with the "id". if it is then how?</p>
  
  <p>I have tried this:</p>
  
  <pre><code>&lt;a id="various3" href="picture.php?id=',$pid,'&amp;dept=',$dept,'" title="'.$info.'"&gt;&lt;img src="picture.php?id=',$pid,'&amp;dept=',$dept,'" width="150" height="210"&gt;&lt;/a&gt; 
  </code></pre>
  
  <p>with matching </p>
  
  <pre><code>$sql = sprintf("select pics, ext from 06-07 where id='%d' AND dept='%s'", $_GET['id'], $_GET['dept']); but it doen't work. what's wrong?
  </code></pre>