I am trying to use prepared statements using PDO in PHP. It seems to work fine until I am try return a name with white spaces.
For Example I can return a name like Apple with no issues but I can not return any results for packard bell, Hewlett Packard, etc.
I've tested on multiple different names and when I hard code in packard bell or Hewlett Packard the query returns the results as expected.
Here is the query with the prepared statement I am using.
$stmt = $conn->prepare('SELECT * FROM job WHERE client_name = :customer ORDER BY job_date DESC');
$stmt->execute(array(
'customer' => $customer,
));
When I query for names with white spaces I do not receive any errors I am forwarded to the results page as usual. The problem is the results page is empty even though there are rows in the database. Is there something I have to do with inverted commas or quotations to fix this.
Thank You
$stmt->errorInfoafter youexecute)