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(), true));
}
else
{
echo '<script language="javascript">';
echo 'alert(Alert what Happend!)'; //not showing an alert box.
echo '</script>';
}
sqlsrv_close($conn);
?>
I took out the private data and replaced it with random names. I am happy about any help.
$sql .=with the.) because at the moment it overwrites it.