Answer the question
In order to leave comments, you need to log in
What is the difference between execute and bindParam?
Good day. I started to translate the site from php 5.6 to 7, I make requests like this:
$user = $pdo->prepare("SELECT * FROM `users` WHERE `login`=? AND `password`=?");
$user->execute(array($login,$password));
$count_sites = $pdo->prepare("SELECT * FROM `sait` WHERE `category` = ? AND `hosts` > '0' AND `status` = '1'");
$count_sites->execute(array($cat['id']));
Answer the question
In order to leave comments, you need to log in
execute puts all parameters into strings and a query, for example, to paginate a view
...(select bla-bla-bla limit ?, ?)->execute([1, 10])...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question