I have the following code
$stmt = odbc_prepare($conn, 'SELECT tpedidos.*, users.nome FROM tpedidos, users WHERE CODCLI IN (SELECT idCliente FROM ligacoes WHERE idGest =?) AND tpedidos.estado =? AND users.id=tpedidos.CODCLI');
$success = odbc_execute($stmt, array($gestor, $estado));
My problem is that the $gestor is not being well read in the query and if i put a value instead of the '?' it works.
What can i do?
Thanks in advance!
EDIT 1:
Warning: odbc_execute(): SQL error: [Microsoft][ODBC SQL Server Driver]Syntax error or access violation, SQL state 37000 in SQLDescribeParameter in C:****\file.php on line 720