php - function bindParam() on a non-object -
not sure missing, , couldn't find answer on other forums or google. ._. suppose add in query?
$sth->bindparam(1, $name); $sth->bindparam(2, $comment); $sth = $db-("insert comment ('name', 'comment') values (:name, :comment)"); $sth->execute();
the sequence should :
$sth = $db->prepare("insert comment ('name', 'comment') values (:name, :comment)"); $sth->bindparam(':name', $name,pdo::param_str); $sth->bindparam(':comment', $comment,pdo::param_str); $sth->execute();
Comments
Post a Comment