如何在codeigniter中获取大于和小于数字的数据

$this->db->select('*');
    $this->db->from('draw');
    $this->db->where('Bond#' >= $data['from']);
    $this->db->where('Bond#' <= $data['to']);
    return $this->db->get();

This is query by me, but it's showing this output:

Array ( [list] => CI_DB_mysqli_result Object ( [conn_id] => mysqli Object ( [affected_rows] => 0 [client_info] => mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $ [client_version] => 50011 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [error_list] => Array ( ) [field_count] => 8 [host_info] => localhost via TCP/IP [info] => [insert_id] => 0 [server_info] => 5.7.17 [server_version] => 50717 [stat] => Uptime: 1930 Threads: 1 Questions: 1153 Slow queries: 0 Opens: 135 Flush tables: 1 Open tables: 122 Queries per second avg: 0.597 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 101 [warning_count] => 0 ) [result_id] => mysqli_result Object ( [current_field] => 0 [field_count] => 8 [lengths] => [num_rows] => 0 [type] => 0 ) [result_array] => Array ( ) [result_object] => Array ( ) [custom_result_object] => Array ( ) [current_row] => 0 [num_rows] => [row_data] => ) )

You should separate the column name and data using a comma(,) in the where clause.

Change the query like this.

$this->db->select('*');
    $this->db->from('draw');
    $this->db->where('Yourfieldname >=', $data['from']);
    $this->db->where('Yourfieldname  <=', $data['to']);
    return $this->db->get();

according to the documentation, you must replace Bond# by the name of the column and change your query: https://www.codeigniter.com/user_guide/database/query_builder.html#looking-for-specific-data

$this->db->select('*');
$this->db->from('draw');
$this->db->where('Bond# >=', $data['from']);
$this->db->where('Bond#', $data['to']);
return $this->db->get();

Bond# MUST be the name of the column in your query.