i am trying to use prepared statements but having trouble getting it to successfully run. here is my code:
function addAlbum($album){
$connection = mysqli_connect(HOST,USER,PASS,DATABASE);
/*$sql = 'INSERT INTO `'.TABLE_ALBUMS.'` (albumName) VALUES ("'.$album.'")';
$result = mysqli_query($connection,$sql);*/
$stmt = $dbh->prepare('INSERT INTO `'.TABLE_ALBUMS.'` (albumName) VALUES ("'.$album.'")');
$stmt->bindParam(':albumName', $album);
$result = $stmt->execute();
if($result){
header("Location: index.php?success");
} else {
header("Location: index.php?fail");
}
}
i hataları firefox ile bu koştu ve bu ne olsun:
Fatal error: Call to undefined method mysqli_stmt::bindParam() in /Applications/MAMP/htdocs/PHPproject/includes/functions.inc.php on line 16
i yanlış gidiyorum biri bana söyleyebilir misiniz?
çok teşekkürler