【问题标题】:Remove double quotes from query codeigniter 3从查询codeigniter 3中删除双引号
【发布时间】:2022-01-16 12:21:38
【问题描述】:

当我在 codeigniter 中使用 get() 方法时,我得到以下查询:

SELECT * FROM "table_users" WHERE "mail" = 'test@test.com'

代替:

SELECT * FROM table_users WHERE mail = 'test@test.com'

这会导致它无法在 Oracle 11g 中正常工作,因为双引号不应与表名一起使用。

我收到以下错误:

Error Number: 942

ORA-00942: table or view does not exist

SELECT * FROM "table_usuarios" WHERE "correo" = 'test@test.com'

Filename: C:/xampp/htdocs/Tecnologico/system/database/DB_driver.php

Line Number: 691

【问题讨论】:

    标签: sql oracle11g codeigniter-3


    【解决方案1】:

    我解决了,至少暂时解决了。

    编辑文件系统/数据库/DB_driver.php

    在 query() 函数中,我们添加以下行:

        $sql = str_replace('"',"",$sql);
    

    就在评论之前:

        // Run the Query
    

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2018-08-02
    • 2015-01-29
    • 2011-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多