Created
August 14, 2009 07:56
-
-
Save egi/167700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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