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 — フィールド長を得る
説明
int mssql_field_length
( resource $result
[, int $offset
] )
結果 result のフィールド番号 offset のフィールド長を返します。
パラメータ
- result
-
処理対象となる結果リソース。これは mssql_query() のコールによって取得します。
- offset
-
フィールドオフセット。0 から始まります。 省略した場合は現在のフィールドを使用します。
返り値
成功した場合は指定したフィールドの長さ、 失敗した場合は FALSE を返します。
注意
注意: Win32 ユーザへの注意
PHP が使用している API(MS DbLib C API)の制限により、VARCHAR フィールドの長さは 255 までに限定されます。 それ以上のデータを保存したい場合は、かわりに TEXT フィールドを 使用します。
mssql_field_length
zz(lost dot childz at gmail dot com)
31-Oct-2007 08:41
31-Oct-2007 08:41
09-Feb-2005 06:56
You can also work around this limitation with the following:
-- for example, with MyVarCharField VARCHAR(1000)
SELECT CAST(MyVarCharField AS TEXT) FROM MyTable
