Sync. 2 database tables properly
<p>I want to synchronise 2 database tables located in 2 differents servers with a different schema, for example :</p>

<p>Table A fields : id, article_value</p>

<p>Table B fields : article_id, article</p>

<p>Table A is used by one program, table B by an other program.</p>

<p>I want to create a synchronisation script which sync both tables to have the same entries. </p>

<p>I have thought about creating 1 table containing the fields :</p>

<p>A_number (number of articles in table A), B_number (number of articles in table B).</p>

<p>So when the script is launched it counts the number of entries in Table A, and compare with the field A_number. If there is more entries, it adds them in Table B and then update A_number.</p>

<p>Same thing in the other direction.</p>

<p>Is this the best way to do that ? in php</p>
