โค้ด: เลือกทั้งหมด
IF tag_id_3 > 0 AND tag_id_1 > 0 AND tag_id_2 > 0 AND tag_id_4 <= 0 THEN
SELECT t1.topic_id FROM `tmp_phpbb_m_topictags2` as t1
INNER JOIN `tmp_phpbb_m_topictags3` as t2
ON t1.topic_id=t2.topic_id
INNER JOIN `tmp_phpbb_m_topictags4` as t3
ON t1.topic_id=t3.topic_id
limit 500;
พอเราเพิ่มตัวแปรเข้าไปจะให้ไปเเทนที่ limit 500
โค้ด: เลือกทั้งหมด
IF tag_id_3 > 0 AND tag_id_1 > 0 AND tag_id_2 > 0 AND tag_id_4 <= 0 THEN
SELECT t1.topic_id FROM `tmp_phpbb_m_topictags2` as t1
INNER JOIN `tmp_phpbb_m_topictags3` as t2
ON t1.topic_id=t2.topic_id
INNER JOIN `tmp_phpbb_m_topictags4` as t3
ON t1.topic_id=t3.topic_id
limit tag_limit;
END IF;
One or more errors have occured while processing your request:
The following query has failed: "CREATE DEFINER=`root`@`localhost` PROCEDURE `GetAlltopic22`(IN `alltagid` TEXT, IN `tag_id_1` INT, IN `tag_id_2` INT, IN `tag_id_3` INT, IN `tag_id_4` INT, IN `tag_limit` INT, IN `tag_start` INT) NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER BEGIN CREATE TEMPORARY TABLE IF NOT EXISTS `tmp_phpbb_m_topictags1` SELECT * FROM `phpbb_m_topictags` WHERE FIND_IN_SET (tag_id,alltagid); IF tag_id_1 > 0 THEN CREATE ...............................