Hi,
Im running a script where am I cross matching about 200 000 data sets with each other. Each data set consists of 8 parameters and I want to count all datasets which have similar or the same parameters for each data set.
Right now, I am doing the matching via a MySql query which im calling about 200 000 times. The problem is that using a query is extremely expensive… it takes up to 2 hours until the script is done. So I am wondering if there is a better method to cross match data sets and if some of could help me find a better solution.
While researching I found out that arrays may be a faster alternative to queries. And so far, I identified 3 possible ways for cross matching:
1. nested foreach () loops
foreach($array as ar1)
foreach($array as ar2)
if ($ar1[0] == $ar1[0])….
2. Using an Array_map with Callback function, so that i would have only one "hand coded" loop
foreach($array as arr)
if ($arr[0] == $parameter)….
3. Array walk where i could save one "hand coded" loop as well.
Theoretically would be the best/fastest way to go about it? Can Anyone tell me what technically the difference between those 3 ways is? And which one is the better approach or if there other alternatives to them?
I am thankful for any advice that helps me reduce execution time!
SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built in???
How to ... (FAQs)
... get e-mail notifications
OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables and return which variable that was randomized and output it.Code: <?phpclass hit_chance {
Send inserts to mysql thru port 80
Hi!I have an application that must do some inserts in a mysql db. This db is behind a firewall, and only port 80 is available.My first thougt is to use xml or csv, and in some way parse that using
Image resize
Hi again fellersI managed to sort out the issues with the folder, Final hurdle is this: Code: function ResizeJPEG($filename, $width, $height){ list($width_orig, $height_orig) =
Header redirect
Hello ive got a problem ive got form with its action set to itself.Code: <form id="formID" class="formular" method="post" action=""/>it then runs
Not Loading Function Into Div
I'm not sure whether to put this under the php forum or ajax forum but because I tink it's more of an issue wit the php code itself I decided to put it here. I came across this file from a friend that
First root of a number
Hi, I can't find any function in php to give me the first root of a number.Is there any built-in function for it? For example: 81 => 39 => 364 => 2256 => 2I wrote this
validating url
im trying to validate url's sent to me by a formthe url's im collecting are for placing banners on my site so the url's are the link to there site and url of where there banner isURL's ARE BROKEN INTO
Unable to retreve the values from Mysql Query
Hi, Here is the php code that I have, Query is running properly in phpmyadmin and is resulting 5 which is correct but when i try to get tht in php its not printing the value $sql_query=