$db = new mysqli('localhost','root','nere','deneme');
if ($db->error)
exit();
$stmt = $db->prepare("INSERT INTO deneme VALUES (?,?,?)");
$stmt->bind_param('ssi',$adi,$soyadi,$no);
$adi='recep';
$soyadi='saban';
$no=5;
$stmt->execute();
i got error.
Fatal error: Call to a member function bind_param() on a non-object in C:\wamp\www\rock\index.php on line 10
what I am doing wrong?
Looks like your prepare statement is failing, and $stmt is false (you should add some checking there). Does table deneme actually exists?
it should be something like below. Also you should assign the values to the variables before passing it to
bind_param()
It's also a good idea to tell which columns should be populated in your database: