星期四, 10月 19, 2017

升級PHP7及Phalcon3已知問題


PHP 7

  1. COUNT field incorrect or syntax error
    placeholders must have unique names even if they have the same value
    不確認是PDO還是Phalcon,但知道placeholder不可重覆
    
    $sql = "SELECT * FROM m
    WHERE m.prod_market_sdate <= :nowDate         
    AND m.prod_market_edate >= :nowDate
    $statement = $db->prepare($sql);
    $result = $db->executePrepared(
    $statement,
    array(
    'nowDate' => date("Y-m-d H:i:s", time())
    ),
    array()
    );
    Reference: https://stackoverflow.com/questions/34089614/count-field-incorrect-or-syntax-error
  2. Static property
    
    - $this->$fileErr => $self::fileErr


Phalcon 3

  1. 不可以有重覆的andWhere
    雖然不應該有這問題...
    不過有時候條件太多,看走眼...
    
    $builder->andWhere("name = 'Peter'");
    $builder->andWhere("name = 'Peter'"); //重覆會有錯
    

沒有留言: