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

search for in the

mssql_field_name> <mssql_fetch_row
Last updated: Fri, 03 Oct 2008

view this page in

mssql_field_length

(PHP 4, PHP 5, PECL odbtp:1.1.1-1.1.4)

mssql_field_lengthLit la longueur d'un champ MS SQL Server

Description

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

Retourne la longueur d'un champ numéro offset dans le résultat result .

Liste de paramètres

result

La ressource de résultats à évaluer. Ce résultat provient de l'appel à la fonction mssql_query().

offset

La position du champ, en commençant à 0. Si ce paramètre est omis, le champ courant sera utilisé.

Valeurs de retour

La longueur du champ spécifié en cas de succès, ou FALSE si une erreur survient.

Notes

Note: Note pour les utilisateurs Windows
À cause d'une limitation dans l'API utilisé par PHP (MS DbLib C API), la longueur des champs VARCHAR est limitée à 255. Si vous avez besoin d'enregistrer plus de données, utilisez un champ TEXT à la place.



add a note add a note User Contributed Notes
mssql_field_length
zz(lost dot childz at gmail dot com)
31-Oct-2007 04: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

mssql_field_name> <mssql_fetch_row
Last updated: Fri, 03 Oct 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites