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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:15:41+00:00 2026-05-28T02:15:41+00:00

I want to create a utility in PHP like phpMyAdmin’s import option, which should

  • 0

I want to create a utility in PHP like phpMyAdmin’s import option, which should allow database updates to the remote server via a .sql file without creating a new database.

Since it’s a client side utility, access to cpanel is not allowed.

The app has two kinds of working environments, offline & online.

If the client works offline, they need to take the backup of database and should update the database with remote server similar for online.

Then they have to update the database of remote server.

  • 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-05-28T02:15:42+00:00Added an answer on May 28, 2026 at 2:15 am

    Solution 1

    If you are running your PHP on a Linux system, you can try using the ‘mysql’ command itself. However please note that your PHP installation has the permission to run “system” commands, like system(), exec() etc.

    So here is what I mean to say:

    system("mysql -U{db_user_name} -h{db_host} -P{db_password} < {full_path_to_your_sql_file}");
    

    Please replace,

    {db_user_name} with the DB username,

    {db_host} with the DB host,

    {db_password} with the DB password,

    {full_path_to_your_sql_file} with the path to your SQL file.

    And this of course requires the SQL file to be uploaded.

    Solution 2:

    Read the SQL file line by line and while reading execute each statement using PHP’s standard MySQL library. Something like:

    $arrFile = file("full_path_to_sql_file.sql", FILE_IGNORE_NEW_LINES);
    foreach ($arrFile as $q) {
        mysql_query($q);
    }
    

    However, this might not be as simple as it seems. If your SQL file has comments and other .sql specific statements, you might need to put checks to ignore them. Or better if the SQL file contains nothing but SQL statements.

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

Sidebar

Related Questions

I'd like to create a utility in C# to allow someone to easily create
I want to use NodeJS or Narwhal to create a JS utility which takes
I want to create a windows utility application, which can be called anytime from
I want to create an allocator which provides memory with the following attributes: cannot
I want to create my Rails application with MySQL, because I like it so
I want to create my own user configuration utility targetted for WinCE6 in C++.
I would like to create an utility application that has a navigation based flipside,
I want to implement a utility for myself that should provide a small console
I want to create a utility in Java to automate our building process. The
I'm very new to iPhone development. I want to create a utility application much

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.