Mysql PDO prepare to execute count (PHP)
===

Current I'm trying to query a COUNT(*) using user input, so I want to prepare it, but when I do it there are no response, also I made using this:
http://stackoverflow.com/questions/883365/count-with-pdo <br>
As example, (prepare and query) but they both seems to doesn't work. Why? theres no reason...<br>

    $count = $con->query("SELECT COUNT(*) FROM $table WHERE senha='$senha' AND var='{$ar[$i]}'")->fetchColumn();
        if(count($count)!=0){
            $q = $con->prepare("UPDATE $table SET value=':value' WHERE senha=':senha' AND var=':var'");
            $q->execute(array(':senha' => $senha, ':value' => $ar[$i+1], ':var' => $ar[$i]));
        }else{
            $q = $con->prepare("INSERT INTO $table (id,senha,var,value) VALUES (NULL, ':senha', ':var', ':value')");
            $q->execute(array(':senha' => $senha, ':var' => $ar[$i], ':value' => $ar[$i+1]));
        }

When I were using his first example (using prepare not query passing values using array) didn't work at all, the query one return a number but does not work the `if` (`update` or `insert`) part I've tried a bunch of things and outputs, nothing worked...<br>
Tested while writing this: Query always return 1 on count, `update` still doesn't working, what am I doing wrong?