I have 2 textarea
and the user puts several integers and does the search well, the problem is when he places a enter
more in the end the program fails, any ideas?
So far so good but then come the possible failures:
Here is how I process the information I receive in textarea
.
$supertoken_id = $_POST['supertoken_id'];
$num_bug = $_POST['num_bug'];
if($num_bug!="")
{
$onlyconsonants = str_replace("\n", ',',$num_bug);
$arregloTokens = explode(",",$onlyconsonants);
$longitud=count($arregloTokens);
$vowels = array();
for ($i=0; $i <$longitud ; $i++)
{
$vowels[$i]=trim($arregloTokens[$i]);
}
$stringParaIn = implode(",",$vowels);
//echo "numero de bucc";
$sql = "select * FROM _tablacompleta WHERE num_bug IN (".$stringParaIn.")";
$sql2 = "select * FROM _noarribados WHERE num_bug IN (".$stringParaIn.")";
}
if($supertoken_id!="")
{
$onlyconsonants = str_replace("\n", ',',$supertoken_id);
$arregloTokens = explode(",",$onlyconsonants);
$longitud=count($arregloTokens);
$vowels = array();
for ($i=0; $i <$longitud ; $i++)
{
$vowels[$i]=trim($arregloTokens[$i]);
}
$stringParaIn = implode(",",$vowels);
//echo "numero de token";
$sql = "select * FROM _tablacompleta WHERE supertoken_id IN (".$stringParaIn.")";
$sql2 = "select * FROM _noarribados WHERE supertoken_id IN (".$stringParaIn.")";
}