Im trying to retrive a customer phone numbers from the an table. The problem is that I want to remove all the occurring hyphens in the phone numbers while I'm doing an SELECT. Should I use REPLACE?
function statsUserRing($phone) //Phone is an array containing phone numbers
{
foreach($phone as $p)
{
$p_mod = str_replace('-', '', $p); //Remove the hyphens from the phone numbers in the array
$get_stats = $link->get_object("SELECT REPLACE($p,'-', '') FROM ringupp WHERE telnr='$p_mod'");
}
}
I want to get the records in the ringupp table, based on the phone numbers in the array, but the phone numbers in the table ringupp contains phone numbers with hyphen, but I want to remove the hyphens while im doing the select.
The column that I want to get is called telnr in the table.
Hope you understand me. :)