Answer the question
In order to leave comments, you need to log in
RedBeanPhp How to display images by id?
It is necessary to display pictures by product id..
Two tables:
Product
id title img_id
1 Nike 1
2 Puma 2
id id_img img
1 1 1.png
2 1 2.png
3 1 3.png
<?php foreach ($pay as $p): ?>
<img src="../img/payment/<?= $p['img'];?> ">
<?php endforeach;?>
$pay = \R::findAll ( 'images', 'id_img = "$all->img_id" ' );
$all =\R::getAll ("SELECT * FROM product JOIN images ON product.img_id = images.id_img");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question