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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -