I am looking to get records for the search keyword, $keyword
contains the value for search.
Here is the query:
$qry = sprintf("select name from Objects where name like '%$keyword%'");
Error:
sprintf(): Too few arguments in <b>C:\xampp\ht...
Thanks
sprintf()
takes wildcards that start with %
. Why are you using it in this case anyway, as opposed to:
$qry = "select name from Objects where name like '%$keyword%'";
Or, better yet, using parameterized queries.