I am creating a photo sharing service in php. I use lightbox in jquery that will pop up when we click the "Add" button to add photos. We can upload some photos. I also use ajax to upload photos so that the page does not reload. I want that after I have uploaded the photos, they will be automatically uploaded to my gallery, and the gallery should display new photos without refreshing the page. Photos will have a specific identifier for a specific user in the database, so the change in the table for the user should be explicitly reflected. Now the problem is that I have no control over the lightbox close button. Therefore, I cannot change it to call any other function, so that it executes the request and displays my photos using ajax.I heard that we can automatically detect changes to the database using JSON, but I never used JSON and knew almost nothing about it. Can someone illustrate a simple example in php of how changes can be detected in mysql table using JSON? Is there any other way to achieve it? Please help me.
source
share