I'm wondering if its possible to accomplish the following or if someone can get me started on the right path to learning it myself.

I'd like to take an existing image. As an example lets simple say the image is divided into two parts, left and right.

On the left side of the image, are two images. An image of an apple and and banana. These images would be loaded based on a php query.

I'd like to be able to move the apple or banana from the left side to the right side. And when that is done to update the variable to their new value for posting back to the database.