Starting in PHP with SQL Server 2008. I'd like to know what's wrong with my code.
<?php
$serverName = "DESKTOP-B8EB4SG\SQLEXPRESS";
$connectionInfo = array( "Database"=>"contas", "UID"=>"sa", "PWD"=>"123456" );
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
//$sql = "INSERT INTO usuarios (login, senha) VALUES (?, ?)";
$seleciona = "SELECT numero FROM usuarios WHERE numero=4";
echo "Opa $seleciona ";
I was able to insert data into the database, but I am not able to pull data and play in the variable $ select .
When I access the PHP page the following appears:
What's wrong?