3

https://stackoverflow.com/questions/36433975/can-i-accurately-unserialize-data-just-using-mysql

Just trying to figure out why this was migrated? I only want to use database functions to do the task. Is this more on topic for SO?

Original question:

https://dba.stackexchange.com/questions/134423/can-i-accurately-unserialize-data-just-using-mysql?noredirect=1

2
  • I thought I'd voted "unclear," pending a fuller explanation of the specific terms used and desired outcome. Hence the comment on the question. If I clicked "migrate" that was a brain fart. Sorry for the confusion and delay I caused. Commented Apr 6, 2016 at 11:36
  • @MichaelGreen You did vote to close as unclear, as did mustaccio. Unfortunately, the simple majority of 3/5 is enough to migrate on all sites except SO.
    – Paul White Mod
    Commented Apr 6, 2016 at 11:55

6 Answers 6

5

You will have to wait for answers from the individuals that migrated your question to hear their reasoning, but personally I would not have migrated this question.

I don't think we should be migrating anything except exceptionally good questions that are obviously off-topic for Database Administrators, and obviously on-topic at the target site. Otherwise, we should just comment, vote (including to close) as normal.

The migration will automatically be rejected from Stack Overflow if it ends up being closed there (as anything except a duplicate) or deleted (including by the author). It would still remain closed here, however, until it is edited (to improve it), then reviewed for reopening. Which is probably what should have happened in the first place, without migration.

Update: the question has been deleted on Stack Overflow, so it's now back here, currently closed as off-topic, awaiting improvement:

https://dba.stackexchange.com/questions/134423/can-i-accurately-unserialize-data-just-using-mysql

Related:

What is migration and how does it work? (FAQ)

  • Don't migrate crap!
  • Avoid migrating answered questions.
  • Don't migrate for the sake of migration.
  • Be familiar with the destination site.
  • If you're not sure, don't migrate it.
4

I was one of the voters. To be honest, I was going to vote the question as "unclear what you're asking" because you were expecting database folks to have domain knowledge about what a PHP serialized array looks like and you didn't include any SQL statements, table definitions or anything.

I saw 3 people before me already voted to migrate, and no-one cast another vote (me not being a MySQL guy) and assumed they knew the specifics about the question and felt like maybe they knew more details and thought it was a better fit on SO.

So to summarize, I would've voted to close anyway and changed my mind about the reason because of the earlier votes. Had I closed as unclear I would've probably asked for clarification at the same time, but as I said, the question appeared about PHP and there were already 3 votes to migrate.

Why close the question and ask for clarification at the same time? The question can always be reopened if it gets clarified and if it's closed we don't get answers chasing a moving target or answers that are invalidated when the question changes, which is basically wasting the answerer's time.

4
  • 1
    So your first instinct isn't to ask for clarification, but to just close?
    – LOSTinDB
    Commented Apr 6, 2016 at 1:09
  • 1
    @LOSTinDB sorry I updated the answer but forgot to notify you
    – Tom V
    Commented Apr 6, 2016 at 12:30
  • 6
    @LOSTinDB Just asking for clarification doesn't always work, and often when it does, it leads to clarification in comments. Which someone else then has to incorporate into the question. Voting to close forces the author (or someone else) to actually update the question with clarifications in order for it to become eligible for answers again. Don't take closing as such a negative or personal thing - it's meant to improve content, not hurt people's feelings.
    – Aaron Bertrand Staff
    Commented Apr 6, 2016 at 15:36
  • 2
    "Close early, close often"
    – Paul White Mod
    Commented Apr 8, 2016 at 1:59
3

It seems to me that the php aspects of your question were more emphasized over the MySQL aspects of your question. That is likely one factor that motivated the migration.

It also seems like your question is unclear and/or too broad. The simple answer is: yes you can send data to a database from php and that data can be inserted into normalized tables. Since that question seems to have an obvious answer since many php applications store normalized data into MySQL databases you're probably trying to ask something else....

If you are trying to ask about ORM then I think SO is the place to do that since that responsibility is handled outside of the database. If you want to invent some sort of new implementation that puts the ORM logic in the database then that is way too big of a task for us to help you with here. You would also need to heavily justify why you wanted to take that approach IMO.

3

I voted to migrate that to StackOverflow since serialization is typically performed at the application layer, which allows the CPU-intensive operation to be distributed across many clients instead of it being performed at the server. Doing this work at the server is somewhat likely to result in performance issues.

I felt StackOverflow would result in a better set of answers for your situation.

When you posted the question here, you did not mention anything about requiring MySQL to do the work (other than the title, which I misread). I don't have a problem with it being migrated back here. Perhaps someone here will provide a great answer.

2
  • 1
    OK thanks - the title is "Can I accurately unserialize data just using MySQL?" I can unserialize via php but this just isn't workable as I would have some complex relationships I need to match up based on field values that I would have to hand code instead of just make some mysql rules (or make the array bigger by adding in the rules to the array).
    – LOSTinDB
    Commented Apr 6, 2016 at 1:09
  • 1
    @LOSTinDB then why didn't you add that information in the question?
    – Tom V
    Commented Apr 6, 2016 at 6:11
3

Reading the question, it seems unclear. I don't know what I would have voted if I had seen it, probably to "close as unclear" or make a comment for you (the OP) to clarify it.

Second, you mention that "I only want to use database functions to do the task.". But that was not in the original question. Serializing and unserializing PHP objects sounds like a job for PHP, not MySQL. Had you added that part in the question in the first place, would very probably had avoided the migration.

But errors happen, no procedure is error-free. What can be done now? I think you can flag it for (SO) mod attention, and it could re-migrated back. If that's not possible (not sure really), you could delete from SO and repost it here. I suggest you edit and clarify it in any case.

3

I was deciding between "unclear" and "off-topic". Seeing that the gist of the question was about implementing some logic using a programming language (literally "Can I accurately transpose a php serialized array") I thought it might have a chance on SO, provided that more details would be added. The question is certainly not about database administration.

1
  • Actually, you did vote to close as unclear, not to migrate.
    – Paul White Mod
    Commented Apr 6, 2016 at 11:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .