Langsung ke konten utama

Postingan

Menampilkan postingan dari Desember, 2024

Run multiple SQL Server queries in php

  I would like to run several SQL Server queries in php but he does not want to accept that with me. Here is my php script: <?php error_reporting ( 0 ); $serverName = "SERVERNAME" ; $connectionInfo = array ( "UID" => "Username" , "PWD" => "password" , "Database" => "databasename" , "MultipleActiveResultSets" => true ); $conn = sqlsrv_connect ( $serverName , $connectionInfo ); if ( $conn == false ) { die ( print_r ( sqlsrv_errors (), true )); } $sql = "INSERT INTO TABLE (column) VALUES (?)" ; $tsql = "INSERT INTO TABLE_NEW(column, column, column) Values (?, 'INSERT', 'WEBSERVER')" ; $params = array ( $_POST [ "addSomething" ]); $stmt = sqlsrv_query ( $conn , $sql , $params , $tsql , $params ); if ( $stmt == false ) { die ( print_r ( sqlsrv_errors (), t...