|
|
|
อยากจะครอบฟังก์ชัน trim() ใน mysql_query อย่างไงค่ะ |
|
|
|
|
|
|
|
ตัวอย่างประมาณนี้ค่ะ
TITLE_TH = trim($result["TITLE_TH"]);
Code (PHP)
$sql = mysql_query("UPDATE employee_tb SET
TITLE_TH = '".$result["TITLE_TH"]."',
NAME_TH = '".$result["NAME_TH"]."',
SURNAME_TH = '".$result["SURNAME_TH"]."',
TITLE_EN = '".$result["TITLE_EN"]."',
NAME_EN = '".$result["NAME_EN"]."',
SURNAME_EN = '".$result["SURNAME_EN"]."',
POSITION = '".$result["POSITION"]."',
BU = '".$_REQUEST["bu"]."',
DEPT = '".$result["DEPT"]."',
MODIFIED = NOW(),
MODIFIED_BY = '".$user."'
WHERE EMID = '".$result["EMID"]."' ") or die (mysql_error());
Tag : PHP, MySQL, CakePHP
|
|
|
|
|
|
Date :
2015-05-15 14:03:31 |
By :
loomoo |
View :
665 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ก็แบบนี้แหละครับ TITLE_TH = trim($result["TITLE_TH"]);
Code (PHP)
$sql = mysql_query("UPDATE employee_tb SET
TITLE_TH = '".trim($result["TITLE_TH"])."',
NAME_TH = '".trim($result["NAME_TH"])."',
SURNAME_TH = '".trim($result["SURNAME_TH"])."',
TITLE_EN = '".trim($result["TITLE_EN"]."',
NAME_EN = '".trim($result["NAME_EN"])."',
SURNAME_EN = '".trim($result["SURNAME_EN"])."',
POSITION = '".trim($result["POSITION"])."',
BU = '".trim($_REQUEST["bu"])."',
DEPT = '".trim($result["DEPT"])."',
MODIFIED = NOW(),
MODIFIED_BY = '".trim($user)."'
WHERE EMID = '".trim($result["EMID"])."' ") or die (mysql_error());
|
|
|
|
|
Date :
2015-05-15 14:15:37 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณค่ะ
|
|
|
|
|
Date :
2015-05-15 15:01:11 |
By :
loomoo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|