|
<?php
$dbh = new PDO('sqlite:test.db','', '');
$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)");
$stmt->bindParam(':name', $name);
$stmt->bindParam(':value', $value);
// insert a line
$name = 'one';
$value = 1;
$stmt->execute();
?>
When I execute this code, an error like this
Fatal error: Call to a member function bindParam() on a non-object in C:\xampp\htdocs\1.php on line 4
apperes. Why?
|