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;
mssql_field_length
(PHP 4, PHP 5, PECL odbtp:1.1.1-1.1.4)
mssql_field_length — Lit la longueur d'un champ MS SQL Server
Description
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.
mssql_field_length
31-Oct-2007 04:41
You can also work around this limitation with the following:
-- for example, with MyVarCharField VARCHAR(1000)
SELECT CAST(MyVarCharField AS TEXT) FROM MyTable
