PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, March 4, 2022

[FIXED] How can I import a table by adjusting the record IDs to the existing table?

 March 04, 2022     mysql, phpmyadmin     No comments   

Issue

By default, in phphmyadmin, when exporting a table, there is a string "DROP TABLE IF EXISTS table name;", which means that when importing an exported table, it will replace an existing one (i.e., it will erase the records and insert new ones).

I need to import additional data into an existing table.

But, as I said, the imported table completely replaces the existing one in the database.

And I need THE NEW TABLE TO COMPLEMENT THE "OLD" ONE.

I believe that if the "old" table has the last id=10, then the next id of the imported table will be -11.

(I import the mysqlfile)

Please tell me how to implement this?


Solution

I decided to do this:

  1. rename a table that already exists in the database
  2. importing a new table
  3. combine with UNION

You know the easiest way-write



Answered By - Леонид
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing