Jump to content

Recommended Posts

Hello,

 

I recently lost some data when my pc cashed and I happened to lose the file with database tables for my php program. Now I can't install my program because I dont have the sql statements to structure my db tables.

Any ideas how I can form an sql text file without having to go through the php code file by file, line by line?

 

Thanks in advance

Edited by dotkpay
Link to comment
https://forums.phpfreaks.com/topic/269233-lost-sql-file-for-php/
Share on other sites

You could start by searching the code for SELECT statements to see what you were pulling from the tables. (Although if you're one who uses "SELECT * " you'll find out one reason why it's a bad idea).

 

Ditto for UPDATE statements and INSERTS.

I've found that actually running your code, assuming there is error checking and error reporting logic to display any sql errors and any php detected errors, is a good way of finding table and column names that are actually referenced by the code. You would still need to determine the actual data type for each column.

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.