gpt4 book ai didi

php - CodeIgniter 查询获取位置

转载 作者:行者123 更新时间:2023-11-29 09:44:59 24 4
gpt4 key购买 nike

我有以下内容:

/** Load necessary stuff **/
$this->load->helper('date');

$this->db->get('site_requests');
//echo mdate('%Y-%m-%d %H:%i:%s', now());
//die;
$this->db->where("(created_for <= " . "'2019-04-24 18:47:03'" . ")");
$this->db->get();
print_r($this->db->last_query());

但我收到以下信息:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (`created_for` <= '2019-04-24 18:47:03')' at line 2

SELECT * WHERE (`created_for` <= '2019-04-24 18:47:03')

Filename: modules/sound/models/Sound_request_model.php

Line Number: 35

我做错了什么?

最佳答案

您可以将其放入一个语句中

    $this->db->get_where('site_requests', array('created_for <=', '2019-04-24 18:47:03'));
print_r($this->db->last_query());

您将需要链接 ->result() 或 result_array() 或任何输出函数来获取数据返回。

希望这有帮助

关于php - CodeIgniter 查询获取位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55839712/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com