|
|
|
insert เข้า Database แล้วแต่ไม่เป็นพาสาไทย ทังใส่ meta charset=UTF-8" และ ปรับ DB เป็น Unicode ก็ยังไม่ได้ |
|
|
|
|
|
|
|
Code (PHP)
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><span class="style24">
<? include "menu.php"; ?>
</span></td>
</tr>
<tr>
<td width="1%" height="60"> </td>
<td width="99%" valign="top">
<?
$objConnect = mysql_connect("localhost","root","cEYz*l") or die("Error Connect to Database");
$objDB = mysql_select_db("webnew"); //
mysql_query("SET NAMES UTF-8");
$strSQL = "SELECT * FROM nt_act WHERE name_act = '".trim($_POST["name_act"])."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if($objResult)
{
echo "<table width='346' height='35' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td background='../../images/dug.png'> <span class='style18'> เบซเบปเบงเบเปเปเบเปเบฒเบงเบเปเบณเบเบฑเบเบเบฐเบฅเบธเบเบฒเบเบงเบ”เบชเบญเบ !</span>
</td>
</tr>
</table>";
echo "<meta http-equiv=refresh content=3;URL=data_act_add.php>";
}
else
{
$date_in = date("Y-m-d");
$strSQL = "INSERT INTO nt_act ";
$strSQL .="(id_act,name_act,date_act,detail_act,id_photo,date_in,status_act) ";
$strSQL .="VALUES ";
$strSQL .="('','".$_POST["name_act"]."','".$_POST["date_act"]."','".$_POST["detail_act"]."','','$date_in','') ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "<table width='346' height='35' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td background='../../images/end.png'> <span class='style17'> เบเบฑเบเบ—เบถเบเบชเบณเป€เบฅเบฑเบ”เปเบฅเปเบง</span>
</td>
</tr>
</table>";
echo "<meta http-equiv=refresh content=0;URL=data_act.php>";
//echo "<a href='menu-from.php' title='ยกร…ร‘ยบ'>[ยกร…ร‘ยบรยนรฉร’รร…ร‘ยก]</a>";
}
else
{
echo "Error Save [".$strSQL."]";
}
}
mysql_close($objConnect);
?></td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
</table></td>
</tr>
<!--
<tr>
<td colspan="5" valign="top"> </td>
</tr>
-->
</table>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2012-07-01 13:53:13 |
By :
นก |
View :
998 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|