Thanks in advance healdem!
I'm a little concern about this and ashamed because is all new to me
Quote:
Originally Posted by healdem
im confused
you have two Access db's, you are using PHP
yet you are posing the question in the MySQL forum?
|
I thought mysql people was more used to do this things using ODBC and php
Quote:
Originally Posted by healdem
what defines a row as a duplicate?
I can't see the logic of how rows appear in one or the other db.
|
When some row in mdb1 is checked, it's moved to mdb2, and some times an old system could add a duplicated. But I don't have the source.
All records should be, combinated, sequential, no duplicates, they are in total about 400000 records (both mdb1+mdb2).
Quote:
Originally Posted by healdem
if your problem is that the same rfactura value appears in both DB's then you can identify the duplicates by using a JOIN and decide what to do to elimiate duplicates
ege
SELECT t1.rfactura from MDB1
join MDB2 as t2 on t2.rfactura = t1.rfactura
|
I have to identify the duplicates only, and I don't work often with this :/
$conn=odbc_connect('mdb1','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$conn1=odbc_connect('mdb2','','');
if (!$conn1)
{exit("Connection Failed: " . $conn1);}
$sql = "SELECT t1.rfactura from mdb1 join mdb2 as t2 on t2.rfactura = t1.rfactura";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
while (odbc_fetch_row($rs))
{
$guia=odbc_result($rs,"rfactura");
echo "$guia<br>";
}
odbc_close($conn);
odbc_close($conn1);
echo "done";