Skip to content
Permalink
Browse files

support MySQLi Connection (mysqli API)

  • Loading branch information...
nao-pon committed Sep 10, 2013
1 parent 28e2698 commit 43b4abbd16fc139cc153f73ac08c319ded41295a
Showing with 9 additions and 10 deletions.
  1. +1 −1 html/modules/tagmemo/admin/set_suggest.php
  2. +8 −9 html/modules/tagmemo/complete.php
@@ -80,7 +80,7 @@ function tagmemo_admin_set_suggest()
$res = $xoopsDB->query($query);
if ($res)
{
while($data = mysql_fetch_row($res))
while($data = $xoopsDB->fetchRow($res))
{
$suggest = $data[1];
$ka->get_hiragana($suggest);
@@ -18,18 +18,17 @@
if ($q !== "")
{
mysql_connect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_PASS) or die(mysql_error());
mysql_select_db(XOOPS_DB_NAME);
$link = mysqli_connect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_PASS, XOOPS_DB_NAME) or die(mysql_error());
if (function_exists('mysql_set_charset')) {
mysql_set_charset('utf8');
if (function_exists('mysqli_set_charset')) {
mysqli_set_charset($link, 'utf8');
} else {
mysql_query('SET NAMES utf8');
mysqli_query($link, 'SET NAMES utf8');
}
$q = mysql_real_escape_string($q);
$q = mysqli_real_escape_string($link, $q);
if ($q == ":" || $q == "¡§")
if ($q == ":" || $q == "")
{
$oq = "";
$where = "";
@@ -46,9 +45,9 @@
$query = "SELECT `tag`, `suggest` FROM `".XOOPS_DB_PREFIX."_tagmemo_tag`".$where.$order." LIMIT 30";
$suggests = $tags = array();
if ($result = mysql_query($query))
if ($result = mysqli_query($link, $query))
{
while($dat = mysql_fetch_array($result))
while($dat = mysqli_fetch_array($result))
{
$tags[] = '"'.str_replace('"','\"',$dat[0]).'"';
$suggests[] = '"'.str_replace('"','\"',$dat[1]).'"';

0 comments on commit 43b4abb

Please sign in to comment.
You can’t perform that action at this time.