microsoft SQL database sitting on Microsoft Azure not a local Database using PHP.
This is my code but it is not working.
// Connect to server and select database.
$conn = sqlsrv_connect($host, $con);
$sel = sqlsrv_select_db($con, $db_name);
// Get values from form
$time = $_POST['time'];
$engagements = $_POST['engagements'];
// Insert data into mysql
$sql = "INSERT INTO $tbl_name (Time, Engagements) VALUES ('$time', '$engagements')";
$result = sqlsrv_query($con, $sql);
// if successfully insert data into database, displays message "Successful".
if($con){
echo "Successful";
echo "<BR>";
}
else {
echo "ERROR";}
// // close connection
sqlsrv_close($con);
Please What I MY DOING WRONGLY?
I don't use mssql but I noticed $tbl_name in the insert SQL statement
Обсуждают сегодня