Skip to content

Instantly share code, notes, and snippets.

@egi
Created August 14, 2009 07:56
Show Gist options
  • Save egi/167700 to your computer and use it in GitHub Desktop.
Save egi/167700 to your computer and use it in GitHub Desktop.
<?php
require_once '/Users/egi/Sites/libs/adodb5/adodb.inc.php';
mb_internal_encoding('UTF-8');
header('Content-type: text/html; charset=UTF-8');
$g_dbconn = ADONewConnection('mysql');
$g_dbconn->debug = true;
$g_dbconn->Connect('localhost', 'root', '', 'th');
$g_dbconn->Execute("SET NAMES 'utf8'");
$g_dbconn->Execute("SET CHARACTER SET utf8");
$q = 'ฉันรักเธอ';
$sql = 'INSERT INTO log (q, created) VALUES (?, NOW())';
$g_dbconn->Execute($sql, $q);
$sql = 'SELECT id FROM r WHERE l LIKE "%'.$q.'%"';
print_r($g_dbconn->GetAll($sql));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment