Where should I place my PHP file? It’s currently in a project folder.
I have downloaded the microsoft SQL Server extension in VSCode but still the undefine problem of couldn’t connect the database for running the website.
I’ve even follow the step from Utube but still there’s some errors that I may make careless but I can’t find it.
<?php
$serverName = "localhost";
$database = "WeighingDB";
$uid = "sa";
$pass = "1234567890";
$connectionOptions = [
"Database" => $database,
"UID" => $uid,
"PWD" => $pass
];
$conn = sqlsrv_connect($serverName,$connectionOptions);
if($conn == false)
//die(print_r(sqlsrv_errors(), true));
echo 'failed';
else
echo 'Connected Successfully';
?>
A clear steps guiding me of connecting the PHP to the SQL Server and my other web program(htm, css, js). Connect to database
Ton is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1