1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| <?php
$uid = "sa";
$pwd = "##azertyROOT43";
$serverName = "S0088075\\SQLEXPRESS";
$connectionInfo = array( "UID"=>$uid,
"PWD"=>$pwd,
"Database"=>"Reporting");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));
}
$req = "DECLARE @date nchar(40)
DECLARE @moiss VarChar(20)
DECLARE @annee int
SET @date= ?
SET @moiss= ?
SET @annee= ?
EXECUTE final1 @date,@moiss,@annee";
$date = '01/06/2010';
$moiss = '06';
$annee = '2010';
$stmt1 = sqlsrv_query($conn,$req, array($date, $moiss, $annee));
if( $stmt1 == false )
{
echo "Statement 1 could not be executed.\n";
die( print_r( sqlsrv_errors(), true));
} |
Partager