Jump to content

[SOLVED] array_intersect not showing results


dxdolar

Recommended Posts

I have 2 SQL queries I run, then I assign them to arrays, I need to find and display where they interest. I thought it was easy enough to use array_intersect, but the only thing that displays is "Array", instead of the actual values. Here's the snippet

 

 
$q="SELECT first set of stuff";
$r= mysqli_query ($dbc, $q);
$dirty = array();

			if ( mysqli_num_rows ($r) >= 1){
					while ($row = mysqli_fetch_array ($r, MYSQLI_ASSOC)){
					$dirty [] = $row['ring_name'];
					} //end while
					$clean = array_unique($dirty);


				$q2="SELECT from other stuff
				$r2= mysqli_query($dbc, $q2);
				$cat = array ();

					while ($c = mysqli_fetch_array ($r2, MYSQLI_ASSOC)){
					$cat [] = $c['ring_name'];
					}//end while

				$result = array_intersect($clean, $cat);
				echo $result."<br />";


			}

 

I tried making sure that the values were being stored in $clean and $cat by displaying them, and they're in there alright, it's just after using intersect it doesn't recognize the actual values and it just says, ARRAY ARRAY ARRAY.

 

Any help would be appreciated. Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.