我试图这样做:
$ _ POST ['年']是一年。我想今年和第一年去做 我读了
$year_nb = intval($_POST['year']);
$books = $this->book_model->read("*", array('year_edition' =>($_POST['year'] && ($year_nb - 1))));
我不知道为什么它不起作用...... 如果我这样做,它就会起作用:
$year_nb = intval($_POST['year']);
$books=$this->book_model->read("*", array(
'year_edition' => ($year_nb - 1)
));
或
$annee_nb = intval($_POST['year']);
$books = $this->book_model->read("*", array('year_edition' => $_POST['year']));
但我需要这两年
我的模特:
public function read($selection = "*", $conditions = array(), $champs_order = "titre", $direction_ordre = "ASC", $nombre_limite = "", $debut_limite = NULL) {
$retour = $this->db->select($selection)
->from($this->table)
->where($conditions)
->order_by($champs_order, $direction_ordre)
->limit($nombre_limite, $debut_limite)
->get()
->result_array();
return $retour;
}
感谢您的回答