2009年10月20日星期二

Re: [fw-db] Insert to another table, then compare tables rows

You can use array_diff for that:

$rowArray1 = $row1->toArray();
$rowArray2 = $row2->toArray();
$diff = array_diff($rowArray1, $rowArray2);
var_dump($diff);

--
Hector


On Tue, Oct 20, 2009 at 7:08 PM, jigen7 <i_love_jigen@yahoo.com> wrote:

Hi how can compare two rows in two diffrent table and return the columns and
his values that are not equal so for example i have table1 and table 2 that
has column sum, and vehid , in table1 the sum = 20 and vehid = 1 while in
table2 sum=20 and vehid = 2. so the output must return vehid as on those two
table are not equal??
--
View this message in context: http://www.nabble.com/Insert-to-another-table%2C-then-compare-tables-rows-tp25985445p25985445.html
Sent from the Zend DB mailing list archive at Nabble.com.


没有评论: