Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8223469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:42:44+00:00 2026-06-07T14:42:44+00:00

I would like to move my photo management system from XML to MySQL and

  • 0

I would like to move my photo management system from XML to MySQL and extend functionality of my current system.

Basically, I have few things in MySQL and few in xml files. The situation right now looks like this:

  • “news.xml” – single file:
    there are stored all news on my site (new uploads, votes and coments) and the structure of xml is:

    <all_news>
        <photos>
            <image image_name="photo1.jpg" path="my_photos/" date="12.12.12" info="just Uploaded!" />
        </photos>
        <comments>
            <image image_name="photo1.jpg" path="my_photos/" date="12.12.12" info="just Commented!" />
        </comments>
        <votes>
            <image image_name="photo1.jpg" path="my_photos/" date="12.12.12" info="just Voted!" />
        </votes>
    </all_news>
    
  • “photo1.xml“, “photo2.xml“, “photo3.xml” … – multiple files:
    These files are created dynamically if someone leaves comment on my photo. For example if someone comment my photo, php script automatically create “photo_name.xml” file in format:

    <comments>
        <comment sender='John' text='nice photo!' who='user' date='22.12.12'/>
    </comments>
    
  • “Votes” – MySQL table:
    there are stored all votes, and the structure of the table:

    • id: "photo1.jpg"
    • vote: 5
    • uid: "IP voting person"

Now I would like to merge all these things into a single mySQL database table, so each time when photo is loaded – pull these photo informations from single DB table (instead of loading few xml’s and DB in same time)…

So my question is:
What table structure is the best in this situation for easiest working on (pull data, move, delete, edit, add, sort…)?
Should I keep all things for single file in single row using unique id = “photo.jpg” and multidimensional arrays? Eg:

uid:            photo_name.jpg
path:           my_photos/
isNewPhoto:     array[true, array[info:"just uploaded!"][date:"12.12.12"]] (multi-dimensional array ??)
isNewComment:   array[true, array[info:"just commented!"][date:"12.12.12"]] (multi-dimensional array ??)
isNewVote:      array[true, array[info:"just Voted!"][date:"12.12.12"]] (multi-dimensional array ??)
votes:          1,5,3,2
votesIP:        123123123,123123123,123123123
comments:       array[array[sender][comment][date][who]]] (multi-dimensional array ??)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:42:47+00:00Added an answer on June 7, 2026 at 2:42 pm

    Well you CAN actually do that quite easily, when you serialize the arrays before storing their content into a single column. Wether that is a good idea is another thing. Apart from performance issues you give away any chance to make more complex things like search for single attributes.

    Why do you insist on a single table ? Even when using multiple tables you can retrieve a single entry combined from multiple table entries with a single query. This gives you much more flexibility for further extensions and use cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two divs. I would like to move/populate the text from div id
I have a tomcat/mysql website that I would like to move over to Google
I have two XmlDocuments and I would like to move an XmlNode selected from
I'm using a ContentPlaceHolder and would like to move the onload=Carousel() from the body
I have a simple 'repeat with' in an AppleScript, and would like to move
I would like to move a file or folder from one place to another
I have a bunch of images in SVN I would like to move out
I would like to move the origin from top left to bottom middle of
I have a legacy application that I would like to move over to Symfony2.
I have some code in <head> in .apsx I would like to move to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.