我想知道有什么差别BigInt,MediumInt和Int是...这似乎很明显,他们将允许更大的数字; 但是,我可以制作一个Int(20)或一个BigInt(20),这似乎不一定是大小.
一些见解会很棒,只是有点好奇.我一直在使用MySQL并尝试在选择类型时应用业务需求,但我从未理解这方面.
什么列类型最适合在MySQL数据库中用于布尔值?我用,boolean但我的同事使用tinyint(1).
我正面临一个问题.我已经编写了分页代码.一切都按预期工作,但只有条件不起作用(只有特定条件)这是我的分页代码.
//declaration
public $paginate = array(
'limit' => 50,
'paramType' => 'querystring'
);
//use in action
$this->paginate['ApiLog'] = array('limit' => 50, 'order' => 'ApiLog.id DESC', 'paramType' => 'querystring');
$this->paginate['ApiLog']['conditions'] = array('ApiLog.log_type' => 2);
$this->paginate['ApiLog']['joins'] = array(
array(
'table' => 'users',
'alias' => 'User',
'type' => 'LEFT',
'conditions' => array('User.id = ApiLog.user_id')
)
);
$this->Paginator->settings = $this->paginate['ApiLog'];
$apilogs = $this->Paginator->paginate('ApiLog');
Run Code Online (Sandbox Code Playgroud)
此代码在开发环境中工作并且返回类型为2的日志,但在生产中它只返回类型为1的日志.我花了一整天时间来找出问题.如果我确实添加任何其他条件conditions array确实生效但不生效log_type.我打印查询日志,where clause总是显示log_type = '1'
我已经清除了缓存.任何帮助表示感谢,谢谢.