471,319 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

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

Jul 17 '05 #1
2 1941
In comp.lang.php windandwaves <wi*********@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.

Jul 17 '05 #2
On Wed, 23 Mar 2005 17:34:46 +1200, "windandwaves" <wi*********@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 / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Phil Powell | last post: by
12 posts views Thread by Eva | last post: by
7 posts views Thread by Karin Jensen | last post: by
122 posts views Thread by Einar | last post: by
3 posts views Thread by Lance | last post: by
28 posts views Thread by shana07 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.