I have two very long list:
$countryCode
And
$countryName
To insert these list i have created the following loop:
$i = 0;
$con=mysqli_connect("localhost","root","root","system_bloglic_com_test");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
foreach($countryCode as $cCode){
mysqli_query($con,"INSERT INTO Contries (contries_id, contries_name, contries_code)
VALUES(NULL,$cCode,$countryName[$i])");
$i++;
}
When i run this i get no erros but no rows have been inserted into database how come?
VALUES(NULL,"$cCode","$countryName[$i]")