有没有人知道从 mysqli 的结果集中设置此联系人数组的更简单方法?如果 sql 查询中有语法错误,是否有人有任何好的 mysqli insert php 函数(程序)很容易调试?
$result = mysqli_query($link, 'SELECT id, name, contactNo, email, address, county, country, sourceOfContact, type FROM contacts');
while ($row = mysqli_fetch_array($result))
{
$contacts[] = array('id' => $row['id'],
'name' => $row['name'],
'contactNo' => $row['contactNo'],
'email' => $row['email'],
'address' => $row['address'],
'county' => $row['county'],
'country' => $row['country'],
'sourceOfContact' => $row['sourceOfContact'],
'type' => $row['type']
}