Query array & nbsp; $ str2 & quot; fromcrm_ltsz_customer_info_def & quot; if ($ _ POST [& quot; EmployeeId & quot;]! & Quot; & amp; $ _ POST [& quot; EmployeeId & quot;]! Null) {array conversion problem in CI
Query arrays
$ Str2 = "from crm_ltsz_customer_info_def ";
If ($ _ POST ["EmployeeId"]! = "" & $ _ POST ["EmployeeId"]! = Null)
{
$ Str3 = "bl_salesman_id =". $ _ POST ["EmployeeId"]. "and ";
};
$ Array1 [0] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '01 '");
$ Array1 [1] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '02 '");
$ Array1 [2] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '03 '");
$ Array1 [3] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '04 '");
$ Array1 [4] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '05 '");
$ Array1 [5] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '06 '");
$ Array1 [6] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '07 '");
$ Array1 [7] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '08 '");
$ Array1 [8] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '09 '");
$ Array1 [9] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '10 '");
$ Array1 [10] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '11 '");
$ Array1 [11] = $ this-> db-> query ('SELECT count (customer_id) as 'count ''. $ str2. 'where '. $ str3. "year (create_time) = ". $ _ POST ["CreateTime"]. "and month (create_time) = '12 '");
$ Result = array ();
Foreach ($ array1 as $ v ){
$ Result [] = $ v-> row_array ();
}
Print_r ($ result );
Exit ();
The result is
Array
(
[0] => Array
(
[Count] => 0
)
[1] => Array
(
[Count] => 1
)
[2] => Array
(
[Count] => 0
)
[3] => Array
(
[Count] => 0
)
[4] => Array
(
[Count] => 1
)
[5] => Array
(
[Count] => 0
)
[6] => Array
(
[Count] => 1
)
[7] => Array