I have the following PHP code:
Array:
$eqCodigos = $_POST["eqCodigo"];
Treatment Attempt to write to MySQl
$eqCodigo1 = explode("\n", $eqCodigos);
$eqCodigo2 = array_filter($eqCodigo1);
$eqCodigo = trim($eqCodigo2);
Query mysql_query
mysql_query("INSERT INTO eq_Codigos (idEquipamento, cdCodigo, cdOpAlteracao, cdDtAlteracao) VALUES ('$idEquipamento', '$eqCodigo[0]', '$eqOpAlteracao', NOW()), ('$idEquipamento', '$eqCodigo[1]', '$eqOpAlteracao', NOW())")
Export table after INSERT
INSERT INTO 'eq_Codigos' ('idCodigo', 'idEquipamento', 'cdCodigo', 'cdOpAlteracao', 'cdDtAlteracao') VALUES (27, 164, '123\r', 'Jonatas Messias', '2016-09-23 10:06:16'), (28, 164, '987', 'Jonatas Messias', '2016-09-23 10:06:16');
Only when I save in the database the first Array code gets "\ r" at the end, making it difficult to select.