Jump to content

Reverse Engineer a MySQL Database/Table from PHP source files?


Recommended Posts

Hello All, first time poster long time reader. Perhaps what I am seeking is a little odd, however I am certain that it's been done before (somewhere).

I have the task of resurrecting a php project using MySQL database - however the project did not include a MySQL SQL dump file so that I can easily recreate the Database/Tables. So, I am wondering if anyone has come across a tool or code that will allow me to point to the source code files in a directory and then rebuild the Database/Tables from the SQL code in the PHP source code? Does that make sense? I hope so. It's a fairly hefty project with several dozen .php source files and so I would like to try avoiding a manual line by line code inspection and hand coded MySQL rebuild.

Any suggestions? (I will, if I may, cross post this to the PHP help area as well. My apologies in advance.).

 

Kind Regards,

 

Ed Cox

edward.cox02@gmail.com

Please don't post the same thing in 2 different sections, that could really waste someone's time. 

 

The only thing you may be able to rebuild is the structure.

 

To my knowledge there is no tool to do this.  The only thing I could suggest would be to logically put the table back together.  Go through the sql statements, fields, etc... 

 

*** But, this would is very unsafe, and used only as a last resort.

 

Maybe someone else has a solution, good luck.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.