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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.