MySQL Forums
Forum List  »  Newbie

trouble with two databases and huge data
Posted by: Joseph Puths
Date: July 19, 2005 06:37AM

hi all,
I am working on LAMP, I want to compare datas (say serial number) between two databases,
i am taking serial number from database A and store in a single variable called $numbers, whose code is like

$Query1="SELECT serno
FROM batch,company,card
WHERE batch.batch=card.batch
ORDER BY card.serno";
$cntr=1;
$numbers="";
$db->query($Query1);
$numRows1=$db->numRows();
while($reslt = $db->fetchRow())
{
if($cntr!=$numRows1)
{
$numbers=$numbers."".$reslt[0].",";
}
else
{
$numbers=$numbers."".$reslt[0];
}
$cntr++;

}

And i am querying in the second database B as like,
"SELECT ----------,--------,--------
FROM table
WHERE CardSerialNumber IN($numbers) group by BEGIN_DATE ";

The code is working fine for low quantity of data, that means the result set of Ist query is less than 20000.
But whenever the resultset of first query exceeds more than 2 lakh.. the code wont work...
Any solutions....
Thanks in advance..

Options: ReplyQuote


Subject
Written By
Posted
trouble with two databases and huge data
July 19, 2005 06:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.