无法使用Codeigniter 4模型获取记录

发布于 2025-02-08 15:33:13 字数 497 浏览 2 评论 0原文

我正在创建RESTFUL API,我在CodeIgnter 4中创建了我的模型,并且在控制器中尝试获取记录时,它会


You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IS NULL
ORDER BY `id` DESC' at line 3;

像在控制器中一样,

    $model = new PlacesModel();
    $data['places'] = $model->orderBy('id', 'DESC')->findAll();
    return $this->respond($data);

在我没有提及任何零或限制的情况下,这会给我带来此错误呢?

i am creating restful api, i have created my model in codeignter 4 and in controller when i try to fetch record it gives me this error


You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IS NULL
ORDER BY `id` DESC' at line 3;

am fetching like in controller

    $model = new PlacesModel();
    $data['places'] = $model->orderBy('id', 'DESC')->findAll();
    return $this->respond($data);

i did not mentioned any null or limit then why am getting this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文