我有两个很长的清单:
$countryCode
和
$countryName
要插入这些列表,我创建了以下循环:
$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++;
}
当我运行它时,我没有得到任何错误,但没有将行插入到数据库中是怎么回事?