SELECT *
FROM datatable
WHERE Name LIKE ?
OR Code LIKE ?
OR Date LIKE ?
OR Inserter LIKE ?
AND ID = \'2\'
There is an error in php
You have 4 ?
parameters and you are binding only one value
$stmt->bind_param("s", $param_term);
This should be
$stmt->bind_param("ssss", $param_term,
$param_term,
$param_term,
$param_term);
so that each parameter ?
gets a value.
Also the query will need bracket to work correctly like this
WHERE (Name LIKE ?
OR Code LIKE ?
OR Date LIKE ?
OR Inserter LIKE ? )
AND ID = '2'
If you want to transfer strictly one copy of parameter into the query (assuming that you search the same pattern) you may use
SELECT *
FROM datatable
WHERE CONCAT_WS(CHAR(X), Name,Code,Date,Inserter) LIKE ?
AND ID = '2'
where CHAR(x) is any char which cannot be found in a field or in a pattern.