title: mysql select - CONCAT no longer working with MariaDB upgrade
body: <p>This code is part of a database search autocomplete function. It was coded a while ago but the database has since been upgraded from mysql to MariaDB.</p>
  
  <p>This is the part of the code giving an error.</p>
  
  <pre><code>$sql = 'SELECT tree_id, tree_common_name, tree_botanical_name FROM all_trees';
  for($i = 0; $i &lt; $p; $i++) {
    $sql .= 'WHERE CONCAT(tree_common_name,tree_botanical_name) LIKE ? ';
  }
   $stmt = $conn-&gt;prepare($sql);
  if($stmt === false) {
    $user_error = 'Wrong SQL: ' . $sql . '&lt;br&gt;' . 'Error: ' . $conn-&gt;errno . ' ' . $conn-&gt;error;
    trigger_error($user_error, E_USER_ERROR);
  }'
  </code></pre>
  
  <p>The error message</p>
  
  <pre><code>PHP Fatal error:  Wrong SQL: SELECT tree_id, tree_common_name, tree_botanical_name FROM all_treesWHERE CONCAT(tree_common_name,tree_botanical_name) LIKE ? &lt;br&gt;Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(tree_common_name,tree_botanical_name) LIKE ?' at line 1 in /home/wiwi1740/public_html/includes/autocomplete.php on line 73
  </code></pre>
  
  <p>I've looked at using 
  <code>$sql .= 'WHERE CONCAT_WS(' ',tree_common_name,tree_botanical_name) LIKE ? ';</code>
  but still throws an error.</p>
  
  <p>Any tips would be appreciated. This code originally came from someone else that I adapted for my client.</p>