มีวิธีที่ทำให้ค้นหาข้อมูลเป็นภาษาไทยได้ไหมครับคือตอนนี้ที่ทำได้มันจะค้นเจอเฉพาะอักษรที่เป็นภาษาอังกฤษถ้าใครพอมีวิธีช่วยแนะให้ด้วยนะครับ
repair_listedit.php
<?php require_once('Connections/cat.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "-1";
if (isset($_GET['txtsearch'])) {
$colname_Recordset1 = $_GET['txtsearch'];
}
mysql_select_db($database_cat, $cat);
$query_Recordset1 = sprintf("SELECT * FROM repair_info WHERE cust_name LIKE %s ORDER BY cust_name ASC", GetSQLValueString("%" . $colname_Recordset1 . "%", "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $cat) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<head><title>แก้ไขรายการแจ้งซ่อม</title>
<style type="text/css">
/* css สำหรับกำหนดรูปแบบของกล่องข้อความ Tooltip */
</style>
<link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.9.2.custom.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.9.2.custom.min.css" media="all" />
<script type="text/javascript" src="jqueryver1.8.3.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
<div align="center"><form action="repair_listedit.php">
<label for="txtsearch">ค้นหา</label><input type="text" name="txtsearch" id="txtsearch"><input type="submit" name="btnsearch" id="btnsearch">
</form></div>
<?
$objConnect = mysql_connect("localhost","root","12345") or die("Error Connect to Database");
@mysql_query("SET NAMES 'tis620'");
$dbname= "cat_system";
$objDB = mysql_select_db("cat_system");
$strSQL = "SELECT * FROM repair_info";
$sqlquery=mysql_db_query( $dbname,$strSQL); //ให้แสดงข้อมูลที่อยู่ในฐานข้อมูล
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<div align="center" class="th" style="width: auto; height: auto; overflow-x: scroll; scrollbar-arrow-color:blue; scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888">
<table width="2000" border="1" align="center" cellspacing="0" id="table1" >
<tr>
<th align="center" bgcolor="#99FF66"> <div align="center">เลขประจำตัวลูกค้า </div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">ชื่อร้าน/หน่วยงาน</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">ชื่อ - นามสกุล</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">สถานที่</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">อาการที่1</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">อาการที่2</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">อาการที่3</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">อาการที่4</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">รายการที่แจ้ง</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">วันที่แจ้ง</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">วันที่นัดซ่อม</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">สถานะ</div></th>
<th width="100" align="center" bgcolor="#99FF66"> <div align="center">การแก้ไข</div></th>
<th width="100" align="center" bgcolor="#99FF66"> <div align="center">ผู้แก้ไข</div></th>
<th width="100" align="center" bgcolor="#99FF66"> <div align="center">แก้ไข</div></th>
<th align="center" bgcolor="#99FF66"> <div align="center">ลบ</div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td align="center"><?php echo $row_Recordset1['repair_id']; ?></td>
<td align="center"><?php echo $row_Recordset1['store']; ?></td>
<td align="center" class="userInfo"><?php echo $row_Recordset1['cust_name']; ?></td>
<td align="center"><?php echo $row_Recordset1['address']; ?></td>
<td align="center"><?php echo $row_Recordset1['check1']; ?></td>
<td align="center"><?php echo $row_Recordset1['check2']; ?></td>
<td align="center"><?php echo $row_Recordset1['check3']; ?></td>
<td align="center"><?php echo $row_Recordset1['check4']; ?></td>
<td align="center"><?php echo $row_Recordset1['cust_alert']; ?></td>
<td align="center"><?php echo $row_Recordset1['date_start']; ?></td>
<td align="center"><?php do { ?>
<?php echo $row_Recordset1['date_finish']; ?>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></td>
<td align="center"><?php echo $row_Recordset1['cust_status']; ?></td>
<td align="center"><?php echo $row_Recordset1['edit_alert']; ?></td>
<td align="center"><?php echo $row_Recordset1['editor']; ?></td>
<td align="center"><a href="repair_edit.php?CustID=<?=$objResult["repair_id"];?>">Edit</a></td>
<td align="center"><a href="confirm_delete.php?CustID=<?=$objResult["repair_id"];?>">Delete</a></td>
</tr>
<?
}
?>
</table>
<div align="center"><?
print "<center><h4>จำนวนลูกค้าที่แจ้งเข้ามา " .mysql_num_rows($sqlquery). " คนมีข้อมูลดังนี้</h4></center>"; ?> </div>
</div>
<?
mysql_close($objConnect);
?>
</body>
<?php
mysql_free_result($Recordset1);
?>
Tag : PHP, MySQL
Date :
2013-01-12 00:19:21
By :
luk101
View :
836
Reply :
1
อ่านเรื่องนี้นะครับ ถ้าอ่านแล้วไม่เข้าใจก็ถามผมได้นะ koromankung[at]gmail.com ปรึกษาฟรีจร้า
Date :
2013-01-12 08:22:58
By :
popnakub
Load balance : Server 00