I have the following data recorded in my column:
As you can see, it's a varchar and one I can record whatever I want, the idea is to create an application in php , that only take me inside the varchar the email , and then update the tuple ...
This is what I have so far:
$listaDeCorreos = mysql_query("SELECT EMAIL, iden FROM planilla", $db);
$cadenaEntrada = $listaDeCorreos;
$patron = '/[a-z0-9_\-\+\.]+@[a-z0-9\-]+\.([a-z]{2,4})(?:\.[a-z]{2})?/i';
preg_match_all($patron, $cadenaEntrada, $matches);
echo $matches[0][0];
As far as I understand, these lines take only email within varchar , but I need advice to perform the part where the value taken in $ matches is rescued and update the tuple with the correct data ...
Table structure:
CREATE TABLE planilla (
EMAIL VARCHAR(40) DEFAULT NULL,
iden MEDIUMINT(9) NOT NULL AUTO_INCREMENT
PRIMARY KEY (iden)
)