Getting metadata from sql server (php) table

I am trying to get metadata from tables in my database (sql server). I execute a query to get this metadata in Sql Management Studio, and it works, but in PHP the script shows this error when I do: $ row = sqlsrv_fetch_array ($ res): "Unexpected SQL type encountered in calc_string_size."

I suspected that the problem was with building the query string in php, but that is not because I typed this request, and that is correct.

The problem occurs when I added a field to select (column description).

Does anyone know this problem?

+4
source share
3 answers

You probably got

sql_variant

- . β†’

VARCHAR

+4

, .

:

$ = sqlsrv_query ($ , $SQL);/ / while ($ row = sqlsrv_fetch_array ($ res)) {/* , (...) }

sql, () , 100%

?

+2

. , . , sql, , varchar. !

+2

Source: https://habr.com/ru/post/1539323/


All Articles