I'm starting in the programming world and start with a problem when I run the query locally the query shows me the return normally but when I try to query through a simple application:
<?php
/**
*
* @var string $dsn : driver de conexão : endereco do servidor : nome do banco
* @var string $user : usuario do banco
* @var string $pass : senha do usuario
*/
$dsn = 'odbc:driver={SQL Server};server=IP_DO_SERVIDOR;database=TESTE';
$user = 'xxxxxxx';
$pass = 'xxxxxxx';
try
{
$pdo = new PDO($dsn,$user,$pass);
}
catch(PDOException $exeption)
{
die("Erro: $exeption");
}
// Definindo o mode de erros da classe
//$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$select = "SELECT * FROM FIN_TITULO WHERE EMPRESA = 1 AND REVENDA = 1 AND TITULO = 435376";
$result = $pdo->exec($select);
var_dump($result);