How can i get data from using date range for querying multiple details from a table?

后端 未结 5 1240
北海茫月
北海茫月 2021-01-23 08:12

I\'ve been able to get multiple details from this table, using the codes beneath the table...

I know the table looks odd, but that\'s the available data table from the cl

5条回答
  •  -上瘾入骨i
    2021-01-23 08:37

    You want to skip lines where there are not exactly 3 elements in the e1 field. After the line: $efind = explode(',', $efind);, add this:

    if (count($efind) !== 3) {
        continue;
    }
    

    Add this in both places.


    Another problem in the code is that when you try to compare dates, you compare strings with <= and >=. You should instead use strcmp().

    Without knowing the entire content of your table, it is hard to see where the undefined index error comes from.

提交回复
热议问题