如何选择两张照片并将它们连接在一起然后将它们发送到数据库

I want to make a website where you can select two photos and join them together as one photo. So the first one you choose gets put on the left and the second one you choose gets put on the left side. And then after that, I want to send that one photo to a database table. Anyone know how I can do that?