PHP Velho Oeste 2024

mssql_field_length

(PHP 4, PHP 5, PECL odbtp >= 1.1.1)

mssql_field_lengthRetorna o tamanho de um campo

Descrição

mssql_field_length ( resource $result [, int $offset ] ) : int

Esta função irá retornar o tamanho do campo número offset no conjunto de resultados result. Se offset for omitido, o campo atual é usado.

Nota: Nota para os usuários de Win32
Devido a uma limitação da API usada pelo PHP (MS DbLib C API), o tamanho de campos VARCHAR é limitado em 255. Se você precisar guardar mais dados, use um campo TEXT.

add a note add a note

User Contributed Notes 2 notes

up
0
zz(lost dot childz at gmail dot com)
16 years ago
there are same problem with VARBINARY, if you are forced to use existing database with such fields you can do it like this:

SELECT CAST(master.dbo.fn_varbintohexstr(VARBINARYFIELD) AS TEXT) FROM table;
up
0
Anonymous
19 years ago
You can also work around this limitation with the following:

   -- for example, with MyVarCharField VARCHAR(1000)
   SELECT CAST(MyVarCharField AS TEXT) FROM MyTable
To Top