is there a quick way to compare the results from two arrays and note the diffences?

This is a discussion on is there a quick way to compare the results from two arrays and note the diffences? within the PHP Language forums, part of the PHP Programming Forums category; is there a quick way to compare the results from two arrays and note the differences? I have two identical ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-23-2005
windandwaves
 
Posts: n/a
Default is there a quick way to compare the results from two arrays and note the diffences?

is there a quick way to compare the results from two arrays and note the differences?

I have two identical tables in MySql (backup and current table) and I want to work out the differences between them (i.e. what
fields are different). I could construct some long function, but I was wondering if anyone had a quick method (I am just learning
PHP).

Thank you


- Nicolaas



Reply With Quote
  #2 (permalink)  
Old 03-24-2005
Daniel Tryba
 
Posts: n/a
Default Re: is there a quick way to compare the results from two arrays and note the diffences?

In comp.lang.php windandwaves <winandwaves@coldmail.com> wrote:
> is there a quick way to compare the results from two arrays and note the differences?


That's an RTFM, see http://www.php.net/manual/en/ref.array.php for all
the array functions.

> I have two identical tables in MySql (backup and current table) and I want to work out the differences between them (i.e. what
> fields are different). I could construct some long function, but I was wondering if anyone had a quick method (I am just learning
> PHP).


Differences in database tables should be computed by the database
itself if possible.

BTW set your width to something beneath 80 to keep you articles
readable.

Reply With Quote
  #3 (permalink)  
Old 03-24-2005
Andy Hassall
 
Posts: n/a
Default Re: is there a quick way to compare the results from two arrays and note the diffences?

On Wed, 23 Mar 2005 17:34:46 +1200, "windandwaves" <winandwaves@coldmail.com>
wrote:

>is there a quick way to compare the results from two arrays and note the differences?
>
>I have two identical tables in MySql (backup and current table) and I want to work out the differences between them (i.e. what
>fields are different). I could construct some long function, but I was wondering if anyone had a quick method (I am just learning
>PHP).


[alt.html removed from crosspost as this is entirely offtopic there. It's
tenuous in comp.lang.php since you haven't mentioned PHP...]

If you have the data in an array, then:
http://uk2.php.net/array_diff

But if you're comparing data, I particularly like the Perl Algorithm::Diff
module.
http://search.cpan.org/~tyemq/Algori...orithm/Diff.pm

Try comp.lang.perl.misc or comp.lang.perl.modules if you like the look of
that.

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0