Closed cagcak closed 10 years ago
A sample SQL query: SELECT USERS.idnumber, SUCCESS_REPORT.subject_name, SUCCESS_REPORT.hours, SUCCESS_REPORT.midterm, SUCCESS_REPORT.final, SUCCESS_REPORT.average, SUCCESS_REPORT.attandance, SUCCESS_REPORT.semester, SUCCESS_REPORT.academic_year FROM USERS INNER JOIN SUCCESS_REPORT ON USERS.iduser=SUCCESS_REPORT.USERS_iduser WHERE USERS.idnumber= '09010102234';
final
USERS_iduser
returns a result like below:
idnumber subject_name hours midterm final average attandance semester academic_year 09010102234 Information Technologies 3 0 0 0 0 spring 2013-2014 09010102234 Conflict Management 3 0 0 0 0 spring 2013-2014
So there are two different records. But only the first one is converted into the JSONArray as shown below:
JSONArray form: [["Information Technologies","3","0","0","0","0","spring","2013-2014"]]
Solved:
http://stackoverflow.com/questions/22522340/using-same-resultset-for-every-row-inside-jsonarray/22522381#22522381
A sample SQL query: SELECT USERS.idnumber, SUCCESS_REPORT.subject_name, SUCCESS_REPORT.hours, SUCCESS_REPORT.midterm, SUCCESS_REPORT.
final
, SUCCESS_REPORT.average, SUCCESS_REPORT.attandance, SUCCESS_REPORT.semester, SUCCESS_REPORT.academic_year FROM USERS INNER JOIN SUCCESS_REPORT ON USERS.iduser=SUCCESS_REPORT.USERS_iduser
WHERE USERS.idnumber= '09010102234';returns a result like below:
idnumber subject_name hours midterm final average attandance semester academic_year 09010102234 Information Technologies 3 0 0 0 0 spring 2013-2014 09010102234 Conflict Management 3 0 0 0 0 spring 2013-2014
So there are two different records. But only the first one is converted into the JSONArray as shown below:
JSONArray form: [["Information Technologies","3","0","0","0","0","spring","2013-2014"]]