Validating $_GET
<p>How do i validate $_GET thats the number coming from correct source.</p>

<p>My url look like : index.php?page=items&amp;catID=5</p>

<p>When users put something like 3 which is doesn't exist on catID. I want it to display  error message.</p>

<pre><code>$catID = intval($_GET["catID"]);

if($catID) {
    $checkSQL = mysql_query("SELECT * FROM category WHERE category_type='2'");
    while($checkROW = mysql_fetch_array($checkSQL)) {
    $checkCAT != $checkROW["categoryID"];
    echo "err msg";
    }
</code></pre>

<p>This i can come up so far but it doesn't working as it fire error msg even in correct page.</p>

<p>Thank you</p>
