PHP code that skips the if and go straight into the else statement
For some reason it wont go into my if statement...

It's probably something obvious but its late and I've been stuck here for a half an hour...

    <?php
                $id = $_GET['id'];
                if ($id == "") {
                    //it goes here correctly
                } else {
                    $result = mysql_query("SELECT * FROM posts WHERE id= $id");
                    if ($result == "0") {
                        //It does not go here.
                    } else {
                       //It goes here correctly
                        }
                    }
                }
                ?>


Much appreciated.. - Luca 
PHP code that skips the if and go straight into the else statement
===

For some reason it wont go into my if statement...

It's probably something obvious but its late and I've been stuck here for a half an hour...

    <?php
                $id = $_GET['id'];
                if ($id == "") {
                    //it goes here correctly
                } else {
                    $result = mysql_query("SELECT * FROM posts WHERE id= $id");
                    if ($result == "0") {
                        //It does not go here.
                    } else {
                       //It goes here correctly
                        }
                    }
                }
                ?>


Much appreciated.. - Luca 