Answer the question
In order to leave comments, you need to log in
Mysqli - how to fix error with bind_param?
$q="Проверка";
$query = $link->prepare("SELECT id, name FROM cities WHERE name LIKE CONCAT(?,'%')");
$query->bind_param('s',$q);
$query->execute();
$res = $query->get_result();
SELECT id, name
FROM cities
WHERE name LIKE CONCAT( 'Мос', '%' )
$query->execute(array($q));
$query = $link->prepare("SELECT id, name FROM cities WHERE name LIKE CONCAT('?','%')");
//$query->bind_param('s',$q);
//$query->execute();
$query->execute(array($q));
$res = $query->get_result();
Answer the question
In order to leave comments, you need to log in
Before connecting to mysqli, we write a magic line
and find out what the problem was with our request
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question