PChart is not easy to identify as a report array in the CI framework.
Last Update:2014-03-27
Source: Internet
Author: User
In the CI framework, pChart is used as a report array, which is difficult to identify. this is the query code $ array1 [0] = $ this-& gt; db-& gt; query ('selectcount (customer_id )'. $ str2. 'wherebl _ salesman_id = '. $ _ POST [the pChart is not easy to recognize in the & quo CI framework for report arrays
This is the query code.
$ Array1 [0] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '01 '");
$ Array1 [1] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '02 '");
$ Array1 [2] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '03 '");
$ Array1 [3] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '04 '");
$ Array1 [4] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '05 '");
$ Array1 [5] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '06 '");
$ Array1 [6] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '07 '");
$ Array1 [7] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '08 '");
$ Array1 [8] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '09 '");
$ Array1 [9] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '10 '");
$ Array1 [10] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '11 '");
$ Array1 [11] = $ this-> db-> query ('SELECT count (customer_id )'. $ str2. 'Where bl_salesman_id = '. $ _ POST ["EmployeeId"]. "and year (create_time) = '20140901' and month (create_time) = '12 '");
$ Result = array ();
Foreach ($ array1 as $ v ){
$ Result [] = $ v-> row_array ();
}
Print_r ($ result );
Exit ();
$ _ SESSION = $ v;
The result is:
Array
(
[0] => Array
(
[Count (customer_id)] => 4
)
[1] => Array
(
[Count (customer_id)] => 1
)
[2] => Array
(
[Count (customer_id)] => 1
)
[3] => Array
(
[Count (customer_id)] => 2
)
[4] => Array
(
[Count (customer_id)] => 2
)
[5] => Array
(
[Count (customer_id)] => 1
)
[6] => Array
(
[Count (customer_id)] => 1
)
[7] => Array
(
[Count (customer_id)] => 3
)
[8] => Array
(
[Count (customer_id)] => 2