Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-15-2009, 09:52 AM   #1
Pics Traffic
Confirmed User
 
Pics Traffic's Avatar
 
Industry Role:
Join Date: Jun 2004
Location: Europe
Posts: 3,055
Another question to MySQL gurus.

So I have a DB that that has 10 tables. Those tables already have some entries in them. I also have sql file that I would like to import in to existing DB and add records from import file but only those that dont exist yet. Basicly some sort of "where not exists" because right now DB has only 400 decords (in main table with primary key "ID").
Both DB and dump file with entries have identical structure. Basicly all records from 401 and up. I hope that makes sense.
Pics Traffic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2009, 09:57 AM   #2
Pics Traffic
Confirmed User
 
Pics Traffic's Avatar
 
Industry Role:
Join Date: Jun 2004
Location: Europe
Posts: 3,055
Looks like INSERT IGNORE INTO is doing it ..
Pics Traffic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2009, 10:13 AM   #3
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
If the IDs match you could be really lazy and just set (if not already) that record as a unique key, then undo the damage after the import.

If you just want to ignore duplicates, INSERT IGNORE is likely what you need.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-15-2009, 10:16 AM   #4
Pics Traffic
Confirmed User
 
Pics Traffic's Avatar
 
Industry Role:
Join Date: Jun 2004
Location: Europe
Posts: 3,055
Quote:
Originally Posted by GrouchyAdmin View Post
If the IDs match you could be really lazy and just set (if not already) that record as a unique key, then undo the damage after the import.

If you just want to ignore duplicates, INSERT IGNORE is likely what you need.
yes, insert ignore did it. Totaly forgot about it.
Pics Traffic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.