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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:02:31+00:00 2026-05-14T05:02:31+00:00

I have a MySQL file which I want to import via PHP 5. In

  • 0

I have a MySQL file which I want to import via PHP 5.

In the name of user friendliness the user should not use tools like PHPmyadmin etc. Just hit a button and the file will get imported.

I have already created code to upload the file to a location on the server.

The file looks like this:

INSERT INTO products VALUES ('', '0', '10', '', '1', 'be34112', '4536.jpg', '','','','0');
SET @master_id = LAST_INSERT_ID();
INSERT INTO products_description VALUES ('', '1', @master_id, '1', 'Kjole', '', 'beskrivelse', '2000', '25', 'kjole.xml', '', '', '');
INSERT INTO products_to_categories VALUES ('',@master_id,'5');
INSERT INTO products VALUES ('', @master_id, '10', '12', '1', 'be34112', '4536.jpg', '200','','','0');
SET @variant_id = LAST_INSERT_ID();
INSERT INTO products_description VALUES ('', '1', @variant_id, '1', 'Kjole', '', 'beskrivelse', '2000', '25', 'kjole.xml', '', '', '');
INSERT INTO options_to_products VALUES ('', @variant_id, '1', '1');
INSERT INTO options_to_products VALUES ('', @variant_id, '', '2');
INSERT INTO products VALUES ('', @master_id, '20', '17', '1', 'be34113', '4537.jpg', '200','','','0');
SET @variant_id = LAST_INSERT_ID();
INSERT INTO products_description VALUES ('', '1', @variant_id, '1', 'Kjole', '', 'beskrivelse æøå ÆØÅ & íjj´¨¨¨¨fdfd""', '3000', '25', 'kjole.xml', '', '', '');
INSERT INTO options_to_products VALUES ('', @variant_id, '1', '');
INSERT INTO options_to_products VALUES ('', @variant_id, '', '4');
  • 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-14T05:02:31+00:00Added an answer on May 14, 2026 at 5:02 am

    Load the file into a string and then pass it to mysqli::multi_query().

    Standard disclaimers regarding untrusted sources for data/queries/executable-code et cetera apply.

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

Sidebar

Related Questions

I am using php and mysql. I have a Database config file (db-config.php) which
I have a members.php page/file in which i want logged in users to see
I have a php file which prints an xml based on a MySql db.
I have a simple file-system-ed-login (not mysql) just to track number of users who
I have a MySQL table which basically serves as a file index. The primary
Long story short, I have a SQL file that I want to import as
I have a php file which pulls some data from external API's, and I
I have a big (1.9 GB) XML file which has data I want to
I have an anchor tag which i want to use to go to a
I am new to Django I have a MySQL database - which I want

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.