comes back not completely enlightened
ok so I've altered my code so it (theoretically) uses the placeholders, but I'm getting the following error message :
Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in C:\Program Files (x86)\EasyPHP-5.3.3\includes\inc_functions.php on line 139
this is the $sql string with the placeholders :
INSERT INTO `page_content` ( cont_id, p_id, p_lang, p_slug, p_meta_title, p_meta_desc, p_meta_keys, p_h1_title, p_h2_title, p_content ) VALUES ('',?,'?','?','?','?','?','?','?','')
this is the array of vars :
$vars = array($p_id,
$v['lang_id'],
$urlSlug,
$_POST['p_meta_title'],
$_POST['p_meta_desc'],
$_POST['p_meta_keys'],
$_POST['p_h1_title'],
$_POST['p_h1_title']);
and this is the way i'm using them :
function insertQuery($conn,$sql,$vars){
$sth = $conn->prepare($sql);
print "<br />SQL = ".$sth->queryString;
$sth->execute($vars);
$insertId = $conn->lastInsertId();
return $insertId;
}
what do you think I need to do ?