0
Starting in PHP with SQL Server 2008. I wonder 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 enter data in the database, but I’m not able to pull data and play in the variable $selects.
When I access the PHP page the following appears:
What’s wrong?
Thank you very much friend, solved!
– Luiz Nascimento