dongnuan7956 2015-10-28 12:45
浏览 33

错误500 Wordpress数据库

I'm getting a error 500 when i try to select something from the database:

I've test it without the select function and just return a random string and it worked. But when i try to get a value from the database i'll get an error 500.

This is the function:

public function seasons_rules($CheckIn)
{
        $Request = $this->db->get_results(
        $this->db->prepare(
        "SELECT A.rule_id
          FROM $this->booking_rules_seasons_table AS A
          INNER JOIN $this->seasons_dates_table AS B
          ON B.season_id = A.seasons_id
          INNER JOIN $this->booking_rules_table AS C
          ON A.rule_id = C.id
          WHERE ('%s' BETWEEN B.start_date AND B.end_date) OR C.all_seasons = 1
          ",$CheckIn), ARRAY_A);

$RulesIDs = '';

if ( ( $Request == NULL ) || ( count( $Request ) == 0 ) ) {
    return false;
} else {
    foreach ($Request as $response) {
        $RulesIDs .= $response['rule_id'].',';
    }
    return $RulesIDs;
  }
}

When i run the query directly into database. I'll get a result back so there isn't any errors in the query.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 求三轴之间相互配合画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站