Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
How to sync two tables in MySQL
prostoalex
follow
0
3-3-2008 12:18 AM
348 views
tags:
mysql
,
synchronization
,
hosting
,
webmaster
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Related Clips
Cheat Sheet Roundup - Over 30 Cheatsheets ...
YFChost.com Free Web Hosting
Typical Blog Commenters
FeedBlendr - Feed Remix Service
Domain Name Portfolio
J2EE (Java Enterprise Edition) - Java Prog...
ScrewTurn Wiki - Overview
More clips from
prostoalex
The Complete Guide for You to Become an Al...
Git Magic
The Art of Engineering
Today's Top Clips
1st time in US: 2 ethics violators on same ticket
Eye Colour
Invisible to the naked eye - Fascinating images of life under the microscope.
Breaking News!!!
Narcissistic People Most Likely To Emerge As Leaders
Domestic Terrorists for McCain
Can human consciousness survive without a brain?
1st double arm transplant
Actively Mixing Church Activities & State Funds - Sarah Palin
Nuns, Congressional candidate, Declared to be Terrorist.
visit the
Top Clips page
View the Top Clips from
March 3, 2008
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/a7388ea5-01ca-4546-b777-920637a62253/2735DD3B-BCD2-423B-B509-CE0D6EFF6A42/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://pabloj.blogspot.com/2008/03/how-to-sync-two-tables-in-mysql.html" href="http://pabloj.blogspot.com/2008/03/how-to-sync-two-tables-in-mysql.html" style="font-size: 11px;">pabloj.blogspot.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://pabloj.blogspot.com/2008/03/how-to-sync-two-tables-in-mysql.html">A question pops out quite often on Devshed forums, <SPAN>"How do I keep table x of my local database in sync with a remote copy?"</SPAN><BR />Usually replication is the suggested answer, but it might be a little overkill, think of those who just want to push the new product catalogue from a local server to their hosted site? No permanent connection and so on ...<BR />In this case the right tool might be a mix of the new MySQL features, federated tables, extended insert synthax, stored procedures, events, triggers ... quite a fest.<BR /><DIV>Say you have a local catalogue table which holds the products on sale:</DIV></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://pabloj.blogspot.com/2008/03/how-to-sync-two-tables-in-mysql.html"><li style="margin-left:16px;padding-left: 0px;"><DIV><SPAN>CREATE</SPAN> <SPAN>TABLE</SPAN> <SPAN>`test`</SPAN>.<SPAN>`catalogue`</SPAN> <SPAN>(</SPAN></DIV></LI><li style="margin-left:16px;padding-left: 0px;"><DIV> <SPAN>`product_code`</SPAN> <SPAN>CHAR</SPAN><SPAN>(</SPAN><SPAN>10</SPAN><SPAN>)</SPAN> <SPAN>NOT</SPAN> <SPAN>NULL</SPAN>,</DIV></LI><li style="margin-left:16px;padding-left: 0px;"><DIV> <SPAN>`product_name`</SPAN> VARCHAR<SPAN>(</SPAN><SPAN>45</SPAN><SPAN>)</SPAN> <SPAN>NOT</SPAN> <SPAN>NULL</SPAN>,</DIV></LI><li style="margin-left:16px;padding-left: 0px;"><DIV> <SPAN>`product_desc`</SPAN> VARCHAR<SPAN>(</SPAN><SPAN>500</SPAN><SPAN>)</SPAN> <SPAN>NOT</SPAN> <SPAN>NULL</SPAN>,</DIV></LI><li style="margin-left:16px;padding-left: 0px;"><DIV> <SPAN>`product_weight`</SPAN> DECIMAL <SPAN>NOT</SPAN> <SPAN>NULL</SPAN>,</DIV></LI><li style="margin-left:16px;padding-left: 0px;"><DIV> <SPAN>`product_colour`</SPAN> VARCHAR<SPAN>(</SPAN><SPAN>45</SPAN><SPAN>)</SPAN> <SPAN>NOT</SPAN> <SPAN>NULL</SPAN>,</DIV></LI><li style="margin-left:16px;padding-left: 0px;"><DIV> <SPAN>PRIMARY</SPAN> <SPAN>KEY</SPAN> <SPAN>(</SPAN><SPAN>`product_code`</SPAN><SPAN>)</SPAN></DIV></LI><li style="margin-left:16px;padding-left: 0px;"><DIV><SPAN>)</SPAN></DIV></LI></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/2735DD3B-BCD2-423B-B509-CE0D6EFF6A42/blog/" title="blog or email this clip"><img src="http://content9.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Blog
Copyright
Privacy
EULA
OK