相关疑难解决方法(0)

MySQL中的类型:BigInt(20)vs Int(20)

我想知道有什么差别BigInt,MediumIntInt是...这似乎很明显,他们将允许更大的数字; 但是,我可以制作一个Int(20)或一个BigInt(20),这似乎不一定是大小.

一些见解会很棒,只是有点好奇.我一直在使用MySQL并尝试在选择类型时应用业务需求,但我从未理解这方面.

mysql types

201
推荐指数
3
解决办法
19万
查看次数

布尔值vs tinyint(1)表示MySQL中的布尔值

什么列类型最适合在MySQL数据库中用于布尔值?我用,boolean但我的同事使用tinyint(1).

mysql sql

116
推荐指数
5
解决办法
9万
查看次数

Cake Php paginator问题

我正面临一个问题.我已经编写了分页代码.一切都按预期工作,但只有条件不起作用(只有特定条件)这是我的分页代码.

//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' 我已经清除了缓存.任何帮助表示感谢,谢谢.

php pagination cakephp paginator cakephp-2.0

8
推荐指数
1
解决办法
254
查看次数

标签 统计

mysql ×2

cakephp ×1

cakephp-2.0 ×1

pagination ×1

paginator ×1

php ×1

sql ×1

types ×1