I am getting a error "Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters in line ---- when i was trying to put it all in the array".
But i don't know how i can make this work. To have the bindingValues with the array working, i keep getting errors while trying.
$text = htmlspecialchars($text);
// prepare the mysql query to select the users
$get_product = $connect->prepare("SELECT name FROM products WHERE name LIKE concat('%', :name, '%') ORDER BY created DESC LIMIT ?, ? ");
$get_product->bindValue(1, $from_record_numLiveSearch, PDO::PARAM_INT);
$get_product->bindValue(2, $records_per_pageLiveSearch, PDO::PARAM_INT);
// execute the query
$get_product -> execute(array('name' => $text));
Thanks for your time and answer.