Update: What I am actually doing:
I am making an ETL tool and writing its script in php:
ETL is being designed for specific domain, the provided data is consistent with its structure but there is some dirtyness in the data which is needed to be removed like H.NO , H#, H.NO. should be = HNO :
I am using approach of stored procedure. In which i created a lookup table for wrong values and replacing them with right values so the final stored data should be perfect.
I have to detect the wrong values in the db table and replace them with the right one's thats all.
I have created an array $find[] that is storing values coming from DB, Then there is a variable $exist , which i want to check if it exists in the $find[wrong] array (column) or not. If It does then its value gets replace with the correspnding cloumn value $find[right]. Kindly let me know how can i do such sort of replacement. Thanks,
Note : My DB table contains only two columns named as wrong and right
When I dump my $find array it gave me the following output:
Array ( [0] => Array ( [0] => FSc [wrong] => FSc [1] => FSC [right] => FSC ) [1] => Array ( [0] => Fsc [wrong] => Fsc [1] => FSC [right] => FSC )
CODE:
$lookup = mysql_query("select * from lookup");
while($getlookup = mysql_fetch_array($lookup))
{
$find[] = $getlookup;
}
print_r($find);
rightandwrongway to approach this problem and I fear you have chosen thewrongway. Are you just trying to get the value forrightthat exists in the database for a given value inwrongthat equals$exists?