검색 입력 GET/POST 데이터하지 내가 정렬 utf8_unicode_ci와 m의 MySQL 데이터베이스에서 태국어 함량이
내가 사용했던 나의 웹 페이지에 올바르게 표시하려면 다음을
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<style type="text/css">
.thai {
font-family:Tahoma, Arial Unicode MS;
font-size: 2em;
</style>
</head>
<body>
<div id="content"><span class="thai"><?php echo $row['description2'];?></span></div>
내 DB 연결 파일은 다음과 같은 코드 있음
mysqli_query($connection, "SET NAMES UTF8");
지금 문제가 올바르게 표시입니다,하지만 내 검색 상자가 그것을 내가를 검색 할 수 없습니다 F 누군가가 태국어에서 검색하려고하지만 다음 데이터베이스
의 영어 콘텐츠 현재 제대로 검색하면 형식으로, 함수 utf8_decode 태국 문자의 변환을 지원하지 않습니다
<form method="GET" action="index.php" accept-charset="UTF-8">
<input class="thai" type="text" charset="UTF-8" class="keyword" value="Search" name="search" id="q" onFocus="if(this.value==this.defaultValue) this.value='';" onBlur="if(this.value=='') this.value=this.defaultValue;" /><br />
</form>
<?php
require_once('inc/connect.php');
//NOT SURE IF THE FOLLOWING DECODING IS MAKING ANY SENSE, I still Get the -No result found- for thai language, but it made the boolean error go away
$search1=$_GET['search'];
$search=utf8_decode($search1);
$select1="SELECT * FROM products where id like '%$search%' || title like '%$search%' || size like '%$search%' ||description1 like '%$search%'|| description2 like '%$search%' order by id asc";
$result=mysqli_query($connection, $select1);
$num=mysqli_num_rows($result);
if($num > 0)
{
while($row=mysqli_fetch_array($result))
{
$oid=$row['id'];
echo $row['title'];
}
}
else{
$ertx="No Records Found In Database";
echo $ertx;
}
?>
에서
: 는 mysqli 오류를 얻기 위해이 코드를 사용해보십시오 $ se arch1 = $ _ GET [ '검색']; $ search = utf8_decode ($ search1); 그냥 사용하는 경우 $ search = $ _GET [ '검색']; 부울 오류가 throw됩니다. –
부울 오류가 발생한 코드의 위치를 알고 있습니까? – wpgbrown
error_reporting (E_ALL)을 사용하여 오류를 활성화하면이 오류를 찾을 수 있습니다. ini_set ('display_errors', 1); – wpgbrown