472,799 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,799 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 2024
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phil Powell | last post by:
/*-------------------------------------------------------------------------------------------------------------------------------- Parameters: $formField1: The name of the first array $formField2:...
12
by: Eva | last post by:
Hi, I try to implement quick sort. I sort vectors by their first value. 10 2 3 4 9 3 5 6 10 4 5 6 must be 9 3 5 6 10 2 3 4 10 4 5 6 The prog works great on maybe 500 vectors, but I have an...
7
by: Karin Jensen | last post by:
Hi I am running a PHP program that connects to an Access 2000 database via ODBC: $results = odbc_exec($connection_id, $sql_select); Is it possible to sort the contents of $results? I wish to...
122
by: Einar | last post by:
Hi, I wonder if there is a nice bit twiddling hack to compare a large number of variables? If you first store them in an array, you can do: for (i = 0; i < n; i++) { if (array != value) {...
3
by: Lance | last post by:
What is the fastest way to determine if two arrays that contain ValueTypes are equal? For example, lets say I have the following: Dim pt1 as New Drawing.Point(1, 2) Dim pt2 as New...
2
by: Tom | last post by:
What's the best way to compare two byte arrays? Right now I am converting them to base64 strings and comparing those, as so: 'result1 and result2 are two existing byte arrays that have been...
28
by: shana07 | last post by:
Friends, I need some inputs about my java program. My program is supposed to store 3 information into an ArrayList so-called arrayOne at each runtime: 1. Unique ID 2. Boolean Value 3. data. ...
0
by: r035198x | last post by:
Inheritance We have already covered one important concept of object-oriented programming, namely encapsulation, in the previous article. These articles are not articles on object oriented...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.