|
|
|
ช่วยดู cofe ให้ที่ครับ ใช้ mssql ครับ : Parse error: syntax error, unexpected 'TEST' (T_STRING) in |
|
|
|
|
|
|
|
error ครับ
Parse error: syntax error, unexpected 'TEST' (T_STRING) in D:\Homepage\ad\insert\save.php on line 13
Code (PHP)
<html>
<head>
<title> Thailand(sqlsrv)</title>
</head>
<body>
<?php
ini_set('display_errors', 1);
error_reporting(~0);
$serverName = "localhost";
$userName = "root;
$userPassword = 'root';
$dbName = "TEST";
$connectionInfo = array("Database"=>$dbName, "UID"=>$userName, "PWD"=>$userPassword, "MultipleActiveResultSets"=>true);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
$sql = "INSERT INTO adm (id, name, title, detailed, resp, other) VALUES (?, ?, ?, ?, ?, ?)";
$params = array($_POST["txtid"], $_POST["txtname"], $_POST["txttitle"], $_POST["txtdetailed"], $_POST["txtresp"], $_POST["txtother"]);
$stmt = sqlsrv_query( $conn, $sql, $params);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
else
{
echo "Record add successfully";
}
sqlsrv_close($conn);
?>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2016-04-04 10:36:08 |
By :
pissanu8970 |
View :
788 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอโทษทีครับ รู้ล่ะครับ
$userName = "root;"
|
|
|
|
|
Date :
2016-04-04 11:56:16 |
By :
pissanu8970 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mssql ถูก deprecated ไปหลาย Version แล้วครับ แนะนำให้ลองดู sqlsrv() ครับ
|
|
|
|
|
Date :
2016-04-04 12:07:58 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|