Lost Database Connection |
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 PHP Code: $this->db_columnas = $this->query->getFieldNames(); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
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. (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. ![]() (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. |
Welcome Guest, Not a member yet? Register Sign In |