多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
``` <?php $serverName = "11.1.111.111,11111"; $database = "XXX"; $username = 'XXX'; $password = 'XXX'; try { $conn = new PDO( "sqlsrv:server=$serverName;Database=$database", $username, $password, array( //PDO::ATTR_PERSISTENT => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) ); $stmt = $conn->prepare("INSERT INTO table_name ( KEYWORD ,LID ) VALUES ( :KEYWORD ,:LID )"); $stmt->bindParam(':KEYWORD', $KEYWORD); $stmt->bindParam(':LID', $LID); // insert a row $KEYWORD = '27'; $LID = '25'; $stmt->execute(); echo "New records created successfully"; } catch(PDOException $e) { die("Error connecting to SQL Server: " . $e->getMessage()); } $conn = null; ```