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’;
or
$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.