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 6965921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:07:27+00:00 2026-05-27T16:07:27+00:00

I’m looking for advice on something I’m building: I have a PHP app that

  • 0

I’m looking for advice on something I’m building: I have a PHP app that creates, updates and deletes records, but it’s tightly integrated in a legacy non-sql based database, and it gets to be really really slow when you start doing lots of DB calls.
I want to make this more of a background experience for the user, so that when user creates or edits something, all the variables, arrays and objects would need to be written to a MySQL database and then a background script would kick off to read those records and process the request to the legacy database.

So I would need one table that keeps track of the task and then another table that would track all of the variables, objects, arrays and their values.

Here’s what I was thinking the DB structure of the 2nd table would have to be:

  • A column to store the task_id
  • A column to store if the var is an array or an object, or NULL if it’s a simple var.
  • A column to store the name of the array/object var.
  • A column for if it’s an object, then to store the type of object it is.
  • A column to store the array/object group ID. (For keeping track of what vars belongs to the object/array)
  • A column to store the name of a simple var, method or name in the object/array
  • A column to store the value of the var

Here would be a few examples:

1 | NULL     | NULL        | NULL          | NULL | 'foo'        | 'bar'
1 | 'array'  | 'foo_array' | NULL          | 1    | 'foo'        | 'bar'
1 | 'array'  | 'foo_array' | NULL          | 1    | 'foo2'       | 'bar2'
1 | 'object' | 'foo_obj'   | foobar_object | 2    | 'foo_method' | 'bar'
1 | 'object' | 'foo_obj'   | foobar_object | 2    | 'bar_method' | 'foo'

Does this seem like an overly complicated approach? Am I crazy and over thinking this? Can someone think of a better way I should approach this?

Thanks.

  • 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-05-27T16:07:28+00:00Added an answer on May 27, 2026 at 4:07 pm

    Use serialize()

    It will generate a specially formatted string(you can store in your database). The string is special in that unserialize() can translate it back into its original php value. It maintains a variables type, value, and structure. Custom objects, and multidimensional arrays are no problem.

    You still need part of your db table, this just does a lot of the work for you, and does it very well.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.