开发者

How to tell a field is nvarchar in CakePHP

开发者 https://www.devze.com 2023-04-10 21:44 出处:网络
I want to make sure that the strings I save to the database are properly formatted in UTF-8. I have converted some of the fields into nvarchar. To save the strings properly I need to prefix all string

I want to make sure that the strings I save to the database are properly formatted in UTF-8. I have converted some of the fields into nvarchar. To save the strings properly I need to prefix all strings with N. e.g. N'my string'.

However not all fields are necessarily nvarchar. In the DboSqlsrv class that I am using that extends DboSource, there is just the one string parameter that you can either specify as 'varchar' or 'nvarchar'.

Does anybody k开发者_开发技巧now if there is a 'cake' way to interrogate the database and check if a field is varchar or nvarchar?


this? http://book.cakephp.org/view/1066/_schema

0

精彩评论

暂无评论...
验证码 换一张
取 消