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

search for in the

mssql_field_name> <mssql_fetch_row
[edit] Last updated: Fri, 24 Feb 2012

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
zz(lost dot childz at gmail dot com) 31-Oct-2007 03:41
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;
08-Feb-2005 01:56
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