โค้ด: เลือกทั้งหมด
SELECT * FROM `phpbb_m_topictags` WHERE `tag_id` = 442 AND `tag_id` = 440
โค้ด: เลือกทั้งหมด
SELECT * FROM `phpbb_m_topictags` WHERE `tag_id` IN (440,442) ORDER BY `tag_id` ASC
Moderator: mindphp
โค้ด: เลือกทั้งหมด
SELECT * FROM `phpbb_m_topictags` WHERE `tag_id` = 442 AND `tag_id` = 440
โค้ด: เลือกทั้งหมด
SELECT * FROM `phpbb_m_topictags` WHERE `tag_id` IN (440,442) ORDER BY `tag_id` ASC
โค้ด: เลือกทั้งหมด
$sql_array = array(
'SELECT' => 'tt.topic_id',
'FROM' => array(
$this->m_topictags => 'tt'
),
'WHERE' => 'tt.tag_id = 440',
);
$where_select_topic = $this->db->sql_build_query('SELECT', $sql_array);
$sql_array = array(
'SELECT' => 'tt.topic_id',
'FROM' => array(
$this->m_topictags => 'tt'
),
'WHERE' => 'tt.tag_id = 442',
);
$where_select_topic_1 = $this->db->sql_build_query('SELECT', $sql_array);
if (!empty($tag_id_search)) {
$sql_array = array(
'SELECT' => 'tt.topic_id',
'FROM' => array(
$this->m_topictags => 'tt'
),
'WHERE' => array(),
'LEFT_JOIN' => array(),
'ORDER_BY' => array(),
'GROUP_BY' => 'tt.topic_id',
);
$sql_array['WHERE'] = 'tt.topic_id IN (' . $where_select_topic . ')';
$sql_array['WHERE'] .= ' AND tt.topic_id IN (' . $where_select_topic_1 . ')';
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$query = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($query)) {
$topic_id_search[] = $row['topic_id'];
}
}
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 66