title: use SESSION id if GET id is not set or empty
body: <p>small little question, how would I be able to use my sessions id if the Get id is not set. Here is my small snippet of code.</p>
  
  <pre><code>    if (isset($_GET['id']) &amp;&amp; is_numeric($_GET['id']) &amp;&amp; intval($_GET['id'])) {
   $id = $_GET['id'];//the user id
      } else {
   $id = $_SESSION['id'];//the user id
      }
  </code></pre>
  
  <p>right now it seems to work fine if the <strong>?id=</strong> isnt set at all, but if its empty it throws off an error</p>
  
  <p><strong>SQL: select * from users where id= >> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1</strong></p>
  
  <p>i pretty much just want to make it fail proof, that it only would use the ID GET if its an actual link such as <strong>profile_pic.php?id=100</strong> but use session when its <strong>profile_pic.php?id=</strong> or <strong>profile_pic.php?id=apples</strong></p>