0
如何限制返回的結果數量?返回結果數量限制
$images = $wpdb->get_col("
SELECT ID FROM $wpdb->posts
WHERE post_type = 'attachment'
AND ID in ($meta)
ORDER BY menu_order ASC
");
如何限制返回的結果數量?返回結果數量限制
$images = $wpdb->get_col("
SELECT ID FROM $wpdb->posts
WHERE post_type = 'attachment'
AND ID in ($meta)
ORDER BY menu_order ASC
");
要限制在5行,請使用以下查詢:
$images = $wpdb->get_col("
SELECT ID FROM $wpdb->posts
WHERE post_type = 'attachment'
AND ID in ($meta)
ORDER BY menu_order ASC
LIMIT 5
");
的感謝!我沒有意識到我不得不在最後。 – JonnyPlow
是的SQL就是這樣的痛苦。可以採取一些習慣。 –