icc97
icc97

Reputation: 12793

How to tell a field is nvarchar in CakePHP

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 know if there is a 'cake' way to interrogate the database and check if a field is varchar or nvarchar?

Upvotes: 1

Views: 173

Answers (1)

Anh Pham
Anh Pham

Reputation: 5481

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

Upvotes: 2

Related Questions