I'm attempting to POST data into a table using PHP and mysql. I have followed numerous guides and the following code has been suggested however it does not appear to be working.
<?php
$connectionInfo = array("Database"=>"rde_487633");
if(isset($_POST['Submitted']))
{
$query = sqlsrv_query "INSERT INTO $location2 (UserID, Name, Surname, Location, Date) VALUES ('$_POST[UserID]', '$_POST[Name]', '$_POST[Surname]', '$_POST[Location]', '$_POST[Date]')";
$stmt = sqlsrv_query( $conn, $sql );
$result = sqlsrv_query($conn, $query);
}
?>
Are there any suggestions as to how this can be improved, and to not get this message;
Parse error: syntax error.