如何将不同数组变量中的数据添加到php中的sql表中

I have been trying to insert data into a table(mySql) from 3 arrays using php. Each time i run the script i get a long list on unsuccesful entries. I am new to php and sql, what am i doing wrong here ? how do i get the query string to recognize these variables ? i have tried searching around but could not make sense of much.

$id=array();
$comp=array();
$mobname=array();

for($x=0;$x<$arrlength;$x++)
{

  if(mysqli_query($con,"INSERT INTO Umobile VALUES ($id[$x],$comp[$x],$mobname[$x])"))
     echo "added",$id[$x]," ",$comp[$x]," ",$mobname[$x];
  else
     echo " unsuccessful ";

    //echo $id[$x]," ",$comp[$x]," ",$mobname[$x];
   echo "<br/>";  
 }

By using this kind of arrays, you assume that your three arrays have the same lengths: $arrlength.

If this statement is true, you could have special characters into your arrays and the query may fail.

You must see at mysqli prepare to escape your values before the insert.