我正在将一个excel文件上传到网站并处理它以供数据库使用.
我正在使用toArray()函数来获取php数组中的所有行.
但我想跳过第一行(标题标题行).其余行将存储在数组中.
我该如何跳过第一行.
注意:我不能使用rangeToArray()函数,因为没有固定的范围来获取行到数组.它是动态的.我想要的只是获取除第一行之外的所有行.
以下JSON数据来自php,

我试过以下代码.但控制台显示undefined错误.
jQuery.each(result.address, function(obj) {
console.log(obj.city);
});
Run Code Online (Sandbox Code Playgroud)
编辑:它也没有工作,抛出未定义的错误.
jQuery.each(result.address, function(obj) {
console.log(obj[0].city);
});
Run Code Online (Sandbox Code Playgroud)
它的工作原理:console.log(result.address.address1.city);.但在这种情况下,address1不是固定的.例如.result.address.xyz.city, result.address.abc.city
我有两个表作为complaints和attachments
我想列出所有投诉及其附件数量(仅计算)。如果从右表 ( attachments) 中没有找到记录,则附件计数为 0。
我正在使用这个查询,
SELECT c.*, IFNULL(COUNT(p.pic_id), 0) FROM complaints c
LEFT JOIN attachments p
ON c.compl_id = p.compl_id
ORDER BY comp_date DESC
Run Code Online (Sandbox Code Playgroud)
attachments但它只是返回右表(表)中存在的行。我只想列出complaints表中的所有行以及相应的附件计数(如果不计数则为 0)。
表格:
complaints
============
compl_id
cust_id
cust_msg
comp_date
attachments
============
pic_id
compl_id
Run Code Online (Sandbox Code Playgroud)
编辑:
complaints
===============
comp1 cust1 abcd 1/1/2015
comp2 cust5 hey 1/1/2015
comp3 cust60 hello 1/1/2015
attachments
===============
a_34554sdfs comp2
1_idgfdfg34 comp2
Run Code Online (Sandbox Code Playgroud)
我想要有这样的结果
comp1 cust1 abcd 1/1/2015 0
comp2 cust5 hey 1/1/2015 2
comp3 cust60 …Run Code Online (Sandbox Code Playgroud)