[英]CakePHP Upper Case Table Name MySQL
I have a MYSQL table being produced and populated by another program that I have no control over, The problem is that the table name is all upper-case "AFTER_HOURS", and if i use 我有一个MYSQL表正在生成并由另一个我无法控制的程序填充,问题是表名是全部大写“AFTER_HOURS”,如果我使用
class ah extends AppModel {
var $name = 'AFTER_HOUR';
var $primaryKey = 'ID';
var $displayField = 'ID';
}?>
i get the error: 我收到错误:
Error: Database table a_f_t_e_r__h_o_u_rs for model Ah was not found. 错误:找不到模型Ah的数据库表a_f_t_e_r__h_o_u_rs。
Im still new to cake, how can i resolve this?? 我还是新蛋糕,我怎么解决这个?
THANKS 谢谢
To specify what table a model should use, do this in your model: 要指定模型应使用的表,请在模型中执行以下操作:
var $useTable = 'AFTER_HOUR';
Details here: http://book.cakephp.org/1.3/view/1059/useTable 详情请访问: http : //book.cakephp.org/1.3/view/1059/useTable
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.