ToddP Posted February 6, 2015 Share Posted February 6, 2015 I'm in need of some assistance. I'm no expert in PHP / MySQL. I have an old website that uses MySQL to store information. I have all of the .php files that have the sql queries in them, but I don't have any of the MySQL table structures. I would have to manually create the tables via phpmyadmin, but I don't know how to extract the correct required table structure from the .php files. Any help would be greatly appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/294438-table-structures/ Share on other sites More sharing options...
Barand Posted February 6, 2015 Share Posted February 6, 2015 You'll have to do it the long way. Examine every query, and the output from those queries, and see what columns are referenced from each table. Just hope the author was sensible enough not to use "SELECT * " in the queries. Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/294438-table-structures/#findComment-1505125 Share on other sites More sharing options...
Psycho Posted February 6, 2015 Share Posted February 6, 2015 To add to Barand's response. As you review the queries make sure you understand the logic needed to run that branch/section of the code. Analyze the queries to build the tables based on the code. Then run the code to execute those sections of code to see if they work. You're bound to have some typos and such along the way. Much better to do a little at a time, find/fix the issues and then continue to expand. Be sure to analyze the code that submits the data to the database or how the data returned form the database is used. This will be valuable in determining field types and other properties. Quote Link to comment https://forums.phpfreaks.com/topic/294438-table-structures/#findComment-1505133 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.