Skip to content

pg_escape_literal() expects parameter 1 to be resource, boolean given #709

Description

@gustavojm

pg_escape_literal() expects parameter 1 to be resource, boolean given

BASEPATH/Database/Postgre/Connection.php at line 217

210      * @param  string $str
211      * @return mixed
212      */
213     public function escape($str)
214     {
215         if (is_string($str) OR ( is_object($str) && method_exists($str, '__toString')))
216         {
217             return pg_escape_literal($this->connID, $str);
218         }
219         elseif (is_bool($str))
220         {
221             return $str ? 'TRUE' : 'FALSE';
222         }
223 
224         return parent::escape($str);

My code:

        $this->db = \Config\Database::connect();
        $fields = $this->db->getFieldData('categories');

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions