如何将mysql保留关键字作为值插入数据库?

问题描述 投票:0回答:1

我已经为该应用程序开发了RestAPI密钥,但我不知道为什么,但是当我尝试使用诸如“具有”之类的字词时,响应给出了403禁止错误。该字段基本上是一个描述框,用户可以在其中输入包括“ Mysqli保留字”在内的任何字,因此不会被插入,否则会显示“ 403 Forbidden error”。

[请尝试使用以下功能以确切了解我的意思?

enter image description here

下面是简单功能:

$$ POST ['word'] ='一个有一个'

public function add_reserved(){
        if (isset($_POST['word'])) {
            print_r($_POST['word']);
        }
    }

哪个出现以下错误:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
    <title>403 Forbidden</title>
</head>
<body>
    <h1>Forbidden</h1>
    <p>You don't have permission to access /askappuser/add_reserved
        on this server.<br />
</p>
</body>
</html>

我已经尝试了许多解决方案,例如使用反引号代替表字段和列名的''(单引号和双引号)。

有人可以建议解决方案吗?

php mysql database mysqli codeigniter-3
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.