$sql = 'SELECT MAX(topic_id) AS max_id FROM ' . POLL_OPTIONS_TABLE; $result = $this->db->sql_query($sql); $max_id = (int) $this->db->sql_fetchfield('max_id'); $this->db->sql_freeresult($result);
return $max_id;
| return [ 'id' => 'topic_id', 'text' => 'poll_option_text', ];
|
protected function get_records_by_range($min_id, $max_id)
| protected function get_records_by_range_query($min_id, $max_id)
|
{ $sql = 'SELECT o.topic_id, o.poll_option_id, o.poll_option_text AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid FROM ' . POLL_OPTIONS_TABLE . ' o, ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p WHERE o.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .' AND t.topic_id = o.topic_id AND p.post_id = t.topic_first_post_id';
|
{ $sql = 'SELECT o.topic_id, o.poll_option_id, o.poll_option_text AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid FROM ' . POLL_OPTIONS_TABLE . ' o, ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p WHERE o.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .' AND t.topic_id = o.topic_id AND p.post_id = t.topic_first_post_id';
|