Try this
$likeVar = "%" . $yourParam . "%";
$stmt = $mysqli->prepare("SELECT * FROM REGISTRY where name LIKE ?");
$stmt->bind_param("s", $likeVar);
$stmt->execute();
you need to prepare the query using simply ?
then you bind the param using bind_param
.
More Related Contents:
- Save the data into a database and return another value from database using PHP
- Commands out of sync; you can’t run this command now
- SELECT COUNT(*) AS count – How to use this count
- Fatal error: Uncaught exception ‘mysqli_sql_exception’ with message ‘No index used in query/prepared statement’
- Using PHP data in MySQL [closed]
- Checking the availability of rooms
- How to properly set up a PDO connection
- How to display errors for my MySQLi query? [duplicate]
- Fatal error: Call to a member function bind_param() on boolean [duplicate]
- How can I with mysqli make a query with LIKE and get all results?
- MySQL Prepared statements with a variable size variable list
- How can I enable the MySQLi extension in PHP 7?
- mysqli_stmt::bind_param(): Number of elements in type definition string doesn’t match number of bind variables
- How can I use mysqli_fetch_array() twice?
- Advantages Of MySQLi over MySQL [closed]
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO [duplicate]
- check if the query results empty row mysqli [duplicate]
- using nulls in a mysqli prepared statement
- PHP – Import CSV file to mysql database Using LOAD DATA INFILE
- How to prepare statement for update query? [duplicate]
- MySql PHP select count of distinct values from comma separated data (tags)
- Laravel Eloquent get results grouped by days
- mysqli – fetch_Array error call to a member function fetch_array() on a non-object mysqli [duplicate]
- Which is fastest in PHP- MySQL or MySQLi?
- mysqli persistent connection
- SELECT row by DATEPART()
- UNION syntax in Cakephp
- Create mysql trigger via PHP?
- How do i search from serialize field in mysql database?
- How to make mysqli connect function?