8土耳其字符在osCommerce

8土耳其字符在osCommerce

本文介绍了UTF-8土耳其字符在osCommerce的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在上安装了osCommerce v2.2 RC2。我的问题是关于左栏(categories.php)



在数据库中我的类别名称是TürkçeKategori,但在前面我看到像T rk eKategori



我试过几个东西,我的数据库字符集是UTF-8,但不能处理。



这里是categories.php;

 < div class = title> 
< img src =theme / images / icons / category.pngalt =Kategoriler/>
< p>KATEGORİLER< / p>
< / div>
< div class =detail>

< ul class =categorytype>








<?php $ query = mysql_query(select * from categories where parent_id = 0);
$ i = 0;
while($ row = mysql_fetch_array($ query))
{
$ cat [$ i] = $ row;
$ cat [$ i] ['categories_name'] = mysql_result(mysql_query(select categories_name from categories_description where language_id = 1 and categories_id ='。$ row ['categories_id']。' ;
$ i ++;
}

if(isset($ session_id))
{
$ cate =& osCsid = $ session_id;
}
else
{
$ cate =;
}

foreach($ cat as $ val)
{
// echo $ val ['categories_id'];
$ sub_query = mysql_query(select * from categories where parent_id ='。$ val ['categories_id']。');
echo'< li>< a href =#>
< img src =theme / images / icons / stars.pngalt =Yıldız/>< span>< b& b>< / span>< / a>
< / li>';

while($ sub_row = mysql_fetch_array($ sub_query))
{
echo'< li>< a href =#>
< img src =theme / images / icons / stars.pngalt =Yıldız/>< a href =kategori.php?cPath ='。$ val ['categories_id']。 '_'。mysql_result(mysql_query('select categories_id from categories_description where categories_id ='。$ sub_row ['categories_id']。'and language_id = 1'),0)。$ cate。'>< span> mysql_result(mysql_query('select categories_name from categories_description where categories_id ='。$ sub_row ['categories_id']。'and language_id = 1'),0)。< / span>< / a>
< / li>';
}

}

?>
解决方案>

这是解决方案;



我在categories.php上添加了这些行(在

  mysql_query(SET NAMES'utf8'); 
mysql_query(SET CHARACTER SET utf8);
mysql_query(SET COLLATION_CONNECTION ='utf8_turkish_ci');


I installed osCommerce v2.2 RC2 on http://www.cwcenerji.com. My problem is about left column (categories.php)

In database my category name is "Türkçe Kategori" but on front side I see it like T�rk�e Kategori

I tried a few things, also my database charset is UTF-8 but couldn't handle.

Here is categories.php;

<div class="title">
                    <img src="theme/images/icons/category.png" alt="Kategoriler"/>
                    <p>KATEGORİLER</p>
                </div>
                <div class="detail">

                    <ul class="categorytype">








                <?php $query = mysql_query("select * from categories where parent_id = 0");
 $i = 0;
 while($row = mysql_fetch_array($query))
{
 $cat[$i] = $row;
$cat[$i]['categories_name'] = mysql_result(mysql_query("select categories_name from      categories_description where language_id = 1 and categories_id = '".$row['categories_id']."'"), 0);
$i++;
}

if(isset($session_id))
{
$cate = "&osCsid=$session_id";
}
else
{
$cate = "";
 }

 foreach($cat as $val)
 {
  //echo $val['categories_id'];
  $sub_query = mysql_query("select * from categories where parent_id = '".$val['categories_id']."'");
  echo '<li><a href="#">
                                <img src="theme/images/icons/stars.png" alt="Yıldız"/><span><b>'.$val['categories_name'].'</b></span></a>
                        </li>';

  while($sub_row = mysql_fetch_array($sub_query))
  {
  echo '<li><a href="#">
                                <img src="theme/images/icons/stars.png" alt="Yıldız"/><a href="kategori.php?cPath='.$val['categories_id'].'_'.mysql_result(mysql_query('select categories_id from categories_description where categories_id = '.$sub_row['categories_id'].' and language_id = 1'),0).$cate.'"><span>'.mysql_result(mysql_query('select categories_name from categories_description where categories_id = '.$sub_row['categories_id'].' and language_id = 1'),0).'</span></a>
                        </li>';
 }

 }

  ?>
解决方案

Here is the solution;

I've added these lines on categories.php (under

mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_turkish_ci'");

这篇关于UTF-8土耳其字符在osCommerce的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 06:04