Lost Database Connection - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Lost Database Connection (/showthread.php?tid=65675) |
Lost Database Connection - portaflex - 07-11-2016 When I use this code: PHP Code: $this->db = \Config\Database::connect($this->base_datos); I get the error: Quote:ErrorException: pg_escape_literal() expects parameter 1 to be resource, boolean given If don't call getFieldNames the error desapears. Thanks RE: Lost Database Connection - InsiteFX - 07-11-2016 PHP Code: $this->db_columnas = $this->query->getFieldNames(); RE: Lost Database Connection - portaflex - 07-11-2016 Thank you for the reply, InsiteFX. But CI4 doesn't like that. It throws this error: Call to undefined method CodeIgniter\Database\Postgre\Builder::getFieldNames() I think it has to be with loosing connection with the DB. Thank you. RE: Lost Database Connection - kilishan - 07-11-2016 (07-11-2016, 06:00 AM)portaflex Wrote: Thank you for the reply, InsiteFX. But CI4 doesn't like that. It throws this error: That will be fixed shortly. There is a bug report that came in over the weekend about this that I haven't had a chance to correct yet. Pull requests are welcome. RE: Lost Database Connection - portaflex - 07-11-2016 (07-11-2016, 06:17 AM)kilishan Wrote: That will be fixed shortly. There is a bug report that came in over the weekend about this that I haven't had a chance to correct yet. You've got it, Kilishan. But I'm not sure it solves the issue. I get very strange behaviour with those three lines: PHP Code: $this->db = \Config\Database::connect($this->base_datos); I have them in a class returning a complete html table. The Error of loosing $this->ConnID comes from escape() method in system/Database/Postgre/Connection.php ONLY when I invoke through an AJAX call from the paginator in the table. If I just refresh the page, those three lines work well. Ain't it weird? I can't figure out the solution, it is beyond my knowledge. Thanks. |