PHP Using SQLSRV Making a Simple Query

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

//Create Connection
$conn = sqlsrv_connect($dbServer, $connectionInfo);

$query = "SELECT * FROM [table]"; 
$stmt = sqlsrv_query($conn, $query);

Note: the use of square brackets [] is to escape the word table as it is a reserved word. These work in the same way as backticks ` do in MySQL.



Got any PHP Question?