Thread:Project talk:Support desk/Storing content in mediawiki database manually (2)

I have started to develop a website using mediawiki. I designed a uploading page (i have not used the mediawiki's default upload page Special:upload). I have created it manually and did my operations like uploading images and stored details in the separate table (not mediawiki's existing table). Now what i need is have to store the group of image details in a particular page should be stored in the mediawiki database for getting the history of that image group, revisions,etc., and i found the uploading images are storing in the following tables

image - for current version

oldimage - for old versions

and pages are stored in the following tables

page - for current page details

revision - for old page versions

Can anyone please explain me how to store the contents into the mediawiki database and getting from the database with all the mediawiki features manually