downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

mssql_field_name> <mssql_fetch_row
[edit] Last updated: Fri, 24 May 2013

view this page in

mssql_field_length

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

mssql_field_lengthRetorna o tamanho de um campo

Descrição

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

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 mssql_field_length - [2 notes]
up
0
zz(lost dot childz at gmail dot com)
5 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
8 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

 
show source | credits | stats | sitemap | contact | advertising | mirror sites