Hi,
I have a file that looks like this
orange
purple
white
I have a database that contains these values:
orange
blue
green
purple
white
I want my script to dispay ONLY the colors that are both in the file AND in the database. So, the script should display
orange
purple
white
I can't seem to get it done. Here is what I have so far...
$access = file('../access/test.inc');
$query = "SELECT * FROM routing";
$result = mysql_query($query);
if (!$result){die ("Error performing query " . mysql_error() );}
while ($row = mysql_fetch_array($result) ){
$DbFolder = $row["choice1"];
if (in_array($DbFolder,$access,true)){
echo $DbFolder;
}
}
The problem with this is that only the last element in my file is being displayed -> "White"
How do I do this? I have been struggling with this for hours now, please help? :S