PHP code example of sadapon2008 / mysql_collate

1. Go to this page and download the library: Download sadapon2008/mysql_collate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sadapon2008 / mysql_collate example snippets


public $default = array(
    'datasource' => 'MysqlCollate.Database/MysqlCollate',
    'persistent' => false,
    'host' => 'localhost',
    'port' => '',
    'login' => 'cakeBlog',
    'password' => 'c4k3-rUl3Z',
    'database' => 'cake_blog_tutorial',
    'schema' => '',
    'prefix' => '',
    'encoding' => 'utf8'
);

$options = array(
    'condition' = array(
        'Post.title LIKE' => 'aBcD',
    ),
    'order' => array(
        'Post.id' => 'ASC',
    ),
);

$this->Post->Behaviors->load(
    'MysqlCollate.MysqlCollate',
    array(
      'Post.title' => 'utf8_unicode_ci',
    )
);

$result = $this->Post->find('all', $options);

$this->Post->Behaviors->unload('MysqlCollate');