I am reading about http://de.php.net/manual/en/pdostatement.execute.php but got confused with the difference between $sth->bindParam(...)
and $sth->execute($parameters)
On hindsight, they look the same. Also the manual is never specific. Why or when to use PDO::PARAM_INT
and PDO::PARAM_STR
?
Lastly, on my code wont return FALSE when the query is "empty".
$sql = 'SELECT `id` FROM `some WORKING sql Statement` WHERE `id` = :id';
$query = self::$dbc->prepare( $sql );
$SHT->bindParam(':uri', $id, PDO::PARAM_INT);
$result = $SHT->execute(); //Row Count not working
if($result) {
//TRUE
...code
}
else {
//FALSE
...code
}