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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:17:07+00:00 2026-06-06T18:17:07+00:00

I FTP source code files and then take a dump of the database (with

  • 0

I FTP source code files and then take a dump of the database (with Drop table option selected) and overwrite live testing server database. But the problem with this is it takes my "junk" testing data along with some required default data. Then I have to manually delete the rows which are not required so that I can give client a clean state. It’d be ideal if I do it through a script which drops existing table and data and create new tables with required default data.

The idea I had was –

$table1 = "sql to create table1";
mysql_query($table1);
$table1_data = "sql to insert default data for table1"; 
mysql_query($table1_data);

and so on for 20+ different tables …

There must be a better way to handle this. What would you say?

** Update **

Is is possible to write all the queries in one variable and run it –
e.g.

$sql =" 
   Drop If exists table1
   create table1 ....
   Insert Into table 1....
   Drop If exists table2
   create table 2
   Insert into table 2 
   .....
   .....
   .....
";
mysql_query($sql);
Is there a way to achieve something like above???
  • 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-06-06T18:17:10+00:00Added an answer on June 6, 2026 at 6:17 pm

    I couldn’t get any answer from the community so I am sticking to my own solution ..

    I created an array of queries –

    $queries[] = 'drop table';
    $queries[] = 'create table';
    $queries[] = 'Insert into table';
    

    and then run each of then in a for loop. Hope it helps someone!

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

Sidebar

Related Questions

I downloaded the source code from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ . Configure went well but when i
I've created a CMS system that grabs website source code from FTP addresses and
I have this source code: public static void FTP_SERVER() { FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftp://myurl.com/mainfolder/);
Alright, so I downloaded the SpiderMonkey source code using the command wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz and
I downloaded the GNU Standard C Library (glibc) source code at http://ftp.gnu.org/gnu/glibc/ . Where
I have a ftp client that allows users to upload files. I want determine
I want to FTP some files across networks using Windows FTP command prompt and
I'm downloading via FTP some files with chinese names (BIG5 encoded), and Filezilla displays
I have downloaded some Office files(doc, xls, pdf etc) on SDcard from FTP server
I'm trying to use Apache Commons Net for FTP file transfers. Problem is files

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.