I am trying to make a simple search process with codes (noob) as follows:
$prep->prepare("SELECT * FROM details WHERE id REGEXP '?'");
$prep->bind_param("s", $search_query);
He gives me this warning:
Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement
I guess this could be because the question mark is also used for RegExp (optional previous character).
Any idea on how to use REGEXP inside prepared statements (without conflicting question marks)?
Thank.
source
share