You need to select data at once from the two tables item_images and item_main, and item_images should have a limit of 1. I make it like this, but displays nothing
//тут выборка из главной таблицы item_main, далее склейка JOIN (SELECT id_item AS id_item2 FROM item_images ORDER BY ASC limit 1) item_images2 ON item_main.id_item = item_images2.id_item2 Update
INNER JOIN item_images ON item_main.id_item = item_images.id_item It works, but there’s no way to push the limit.