title: Server-side processing UTF-8 search in DataTables
body: <p>I use DataTables with server-side processing</p>
  
  <pre><code>$('#usersTable').DataTable(
              {
                  responsive: true,
                  "pageLength": 20,
                  "processing": true,
                  "serverSide": true,
                  "bLengthChange": true,
                  "bSort" : false,
                  "bInfo" : false,
                  "aLengthMenu": [[20, 50, 75, -1], [20, 50, 75, "ყველა"]],
                  "ajax": "helpers/server_processing.php"
              }
          );
  </code></pre>
  
  <p>I also changed db connection in <code>ssp.class.php</code> to</p>
  
  <pre><code>$db = @new PDO(
  "mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
  $sql_details['user'],
  $sql_details['pass'],
  array( PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND =&gt; "SET NAMES 'utf8'" )
  );
  </code></pre>
  
  <p>Still I'm having problems while trying to search UTF-8 characters in search bar</p>
  
  <p><a href="https://i.stack.imgur.com/xYvWT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xYvWT.png" alt="DataTables error"></a></p>
  
  <p>can anybody help?</p>
  
  <p><strong>The queries</strong> (copied from a comment)</p>
  
  <pre><code>SELECT  COUNT(`id`)
      FROM  `users`
      WHERE  (`id` LIKE :binding_0
                OR  `mac` LIKE :binding_1
                OR  `ip` LIKE :binding_2
                OR  `sname` LIKE :binding_3
                OR  `login` LIKE :binding_4
                OR  `tariff_plan_id` LIKE :binding_5
                OR  `now_playing_type` LIKE :binding_6
                OR  `now_playing_content` LIKE :binding_7
                OR  `now_playing_start` LIKE :binding_8
                OR  `keep_alive` LIKE :binding_9
                OR  `id` LIKE :binding_10
                OR  `status` LIKE :binding_11
             ) 
  SELECT  COUNT(`id`)
      FROM  `users`
  SELECT  `id`, `mac`, `ip`, `sname`, `login`, `tariff_plan_id`,
          `now_playing_type`, `now_playing_content`, `now_playing_start`,
          `keep_alive`, `id`, `status`
      FROM  `users`
      WHERE  (`id` LIKE :binding_0
                OR  `mac` LIKE :binding_1
                OR  `ip` LIKE :binding_2
                OR  `sname` LIKE :binding_3
                OR  `login` LIKE :binding_4
                OR  `tariff_plan_id` LIKE :binding_5
                OR  `now_playing_type` LIKE :binding_6
                OR  `now_playing_content` LIKE :binding_7
                OR  `now_playing_start` LIKE :binding_8
                OR  `keep_alive` LIKE :binding_9
                OR  `id` LIKE :binding_10
                OR  `status` LIKE :binding_11
             )
      ORDER BY  id ASC
      LIMIT  0, 20
  </code></pre>
  
  <p><strong>EDIT: additional information</strong></p>
  
  <p>I discovered that LIKE queries with utf-8 values doesn't work with DateTime field in mysql
  <a href="https://i.stack.imgur.com/EymKh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EymKh.png" alt="enter image description here"></a></p>
  
  <p>but DataTables compare every field to search string automatically. Is there an easy way I can tell DataTables not to search DateTime type columns if string contains utf-8 characters?</p>