0
I’m assembling a report using the database of a system and PHP with DBLIB, however, who structured the database created the tables and fields accentuated. When I go to make a query in some field that has not accentuated the query works, but when accent has gives invalid column error.
Example:
select CAST(cp.[vencimento] AS date) as vencimento from contaspagar as cp; //essa funciona de boa
select CAST(cp.[dataemissão] AS date) as dataemissao from contaspagar as cp; //essa da erro de coluna invalida
I’m using Linux, PHP 5.6, and the freetds library to connect to SQL, SQL 2008 express.
Error in PHP:
SQLSTATE[HY000]: General error: 207 General SQL Server error: Check messages from the SQL Server [207] (Severity 16) [(null)]NULL
Meaning of error:
Invalid column name '%. *ls'.
Post the exact error message please.
– Guilherme Nascimento
Does Ygor have any way of telling you exactly what is happening? If we inform you, we may be able to guide you to make it work.
– Guilherme Nascimento
@Guilherme-birth I am mounting a screen in PHP to generate a report, I can already connect to the database and run some query, but some tables in the database have accentuation and when I run the query by PHP tells that the column is with invalid name, but if I run the direct query in management it runs normally
– Ygor Anjos
But put the error exactly, if the exact error message we have no way to deduce anything.
– Guilherme Nascimento
put in question
– Ygor Anjos