codeigniter 4 - ParseError syntax error, unexpected '|', expecting ';' or '{' FC

I use codeigniter 4 and PhpSpreadsheet to export data to excel..when I try it on localhost there are no

I use codeigniter 4 and PhpSpreadsheet to export data to excel..when I try it on localhost there are no problems..but when I try it on hosting, when I export I get an error

ParseError syntax error, unexpected '|', expecting ';' or '{' FCPATH/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php at line 269

my model

public function datapmk($tr = null, $thn = null)
{
    $this->db = \Config\Database::connect();
    $triwulan = "'%" . $tr . "%'";
    $tahun = "'%" . $thn . "%'";
    $this->select("lingkungan_nama,
    COUNT( DISTINCT(urut_rumah)) rmh,
    SUM(CASE WHEN pmk_id = 1 AND  jk = 1 AND triwulan_id LIKE   $triwulan    AND tahun LIKE $tahun THEN 1 ELSE 0 END) AS L_tidak,
    SUM(CASE WHEN pmk_id = 1 AND  jk = 2 AND triwulan_id LIKE $triwulan AND tahun LIKE $tahun THEN 1 ELSE 0 END) AS P_tidak,
    SUM(CASE WHEN pmk_id = 1 AND triwulan_id LIKE $triwulan AND tahun LIKE $tahun THEN 1 ELSE 0 END) AS JLH_tidak");
    $this->groupBy('lingkungan_nama');
    $this->orderBy('lingkungan_nama', 'ASC');
    return $this->get()->getResultArray();
}

php installed on hosting v 8.1.31

I use codeigniter 4 and PhpSpreadsheet to export data to excel..when I try it on localhost there are no problems..but when I try it on hosting, when I export I get an error

ParseError syntax error, unexpected '|', expecting ';' or '{' FCPATH/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php at line 269

my model

public function datapmk($tr = null, $thn = null)
{
    $this->db = \Config\Database::connect();
    $triwulan = "'%" . $tr . "%'";
    $tahun = "'%" . $thn . "%'";
    $this->select("lingkungan_nama,
    COUNT( DISTINCT(urut_rumah)) rmh,
    SUM(CASE WHEN pmk_id = 1 AND  jk = 1 AND triwulan_id LIKE   $triwulan    AND tahun LIKE $tahun THEN 1 ELSE 0 END) AS L_tidak,
    SUM(CASE WHEN pmk_id = 1 AND  jk = 2 AND triwulan_id LIKE $triwulan AND tahun LIKE $tahun THEN 1 ELSE 0 END) AS P_tidak,
    SUM(CASE WHEN pmk_id = 1 AND triwulan_id LIKE $triwulan AND tahun LIKE $tahun THEN 1 ELSE 0 END) AS JLH_tidak");
    $this->groupBy('lingkungan_nama');
    $this->orderBy('lingkungan_nama', 'ASC');
    return $this->get()->getResultArray();
}

php installed on hosting v 8.1.31

Share Improve this question edited Mar 14 at 16:35 James Z 12.3k10 gold badges27 silver badges47 bronze badges asked Mar 14 at 5:47 Franky MoedakFranky Moedak 112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I suspect you will find that your Web hosting is running an older version of PHP. Equally you should look in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php at line 269 and see what is there.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744672437a4587123.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信