Can't automatically use phone number in query

I can not get this to work. I have phone numbers stored in a varchar() field as 123-456-7890. I can pull that information out, but it is not recognized when I sent a query to another table.

I have echo’ed what I am doing and the data is being pulled out.
Example: echo $row[‘phone’] will print out the number.

When I submitt the data as a variable in a query is does not find records that are there. I have tried:

$dups = "
	SELECT email, username FROM user
	WHERE phone1 like '{$row['email']}'

I have tried to put the mysql_fetch_assoc() data into a simpler variable as $fon and it still is not found.

$dups = "
	SELECT email, username FROM user
	WHERE phone1 like '{$fon}'

The only way I can get it to work is to directly assign the value in a line as:

$row[‘email’] = ‘123-456-7890’;
$fon = ‘123-456-7890’;

This I can not do with over 1200 numbers. I need to be able to pull it from the table and use it to query another table. I also tried stripslashes() thinking that might have something to do with it.

what you want is a join query

this will avoid “pulling it” from a table and “using it” to query another table

everything is done with a single query

Thanks. I should have thought of that.