|
|
|
ติดปัญหาการ insert และ select identity (PHP AdoDB / sql server 2008) |
|
|
|
|
|
|
|
php แนะนำให่ใช้ mssql ครับ ทำงานได้เร็วกกว่าครับ
|
|
|
|
|
Date :
2012-04-19 06:07:05 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณค่ะ
|
|
|
|
|
Date :
2012-04-19 08:00:58 |
By :
WoRMGAdE |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รอคำตอบด้วยคนครับ
Code (PHP)
<?php
$serverName = "localhost";
$connectionInfo = array("Database"=>"test","UID"=>"sa", "PWD"=>"123456");
$conn = sqlsrv_connect($serverName, $connectionInfo);
if( $conn === false )
{
echo "failed connection";
}
$tsql = "INSERT INTO Users_info (Username, Email) VALUES ('$Username', '$Email')";
$stmt = sqlsrv_query( $conn, $tsql, array(), array( "Scrollable" => SQLSRV_CURSOR_KEYSET ));
$UserID = ''; #$Userid select มาหลังจาก insert Users_info <--
$tsql = "INSERT INTO [Users_Pass] ([UserID], [Password]) VALUES ('$Userid', '$Password')";
$stmt = sqlsrv_query( $conn, $tsql, array(), array( "Scrollable" => SQLSRV_CURSOR_KEYSET ));
?>
|
|
|
|
|
Date :
2017-04-24 22:24:14 |
By :
Jack |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|