Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6225119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:47:09+00:00 2026-05-24T08:47:09+00:00

I have a problem with the JSON result of my PHP script. I can’t

  • 0

I have a problem with the JSON result of my PHP script. I can’t extract this result in JAVA. There is the error below :

Error converting result org.json.JSONException: Value 
{"3":[{"date":"25\/07\/2011","descr":"Une colloque bla bla","numColloque":"1","titre":"Une colloque"}],
 "2":[{"mail":"jm@dvaid.fr","descr":"truc truc","nom":"Une personne","tel":"0600000000","numPersonne":"1"}],
 "1":[{"lien":"http:\/\/www.irdes.fr","numTypeActu":"1","date":"25\/07\/2011","titre":"Une actualité récente","numActu":"1"}],
 "7":[{"numEtablissement":"1","specialite":"STG","mention":"une mention","modalite":"BTS","titre":"Un titre de formation","numFormationCours":"1"}],
 "6":[{"numEtablissement":"1","numEnseignement":"1","titre":"Cours de bla bla","numEnseignant":"1"}],
 "5":[{"date":"31\/07\/2011","descr":"Université paris descartes dans le 1-ème arrondissement de Paris","numEtablissement":"1","libelle":"IUT Paris DESCARTES"}],
 "4":[{"numDocument":"1","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypeDocument":"1","descrRapide":"un glossaire qui regroupe du bla bla","nom":"un document de glossaire"},
      {"numDocument":"2","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypeDocument":"2","descrRapide":"Une synthèse parlant d'un truc","nom":"Une synthèse"}],
 "9":[{"lien":"http:\/\/www.irdes.fr","descr":"un séminaire sur le blabla","date":"25\/07\/2011","heure":"14h30","nom":"Un séminaire","numSeminaire":"1"}],
 "8":[{"numPublication":"1","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypePublication":"1","titre":"Une publication"},
      {"numPublication":"2","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypePublication":"2","titre":"un titre de publication"},
      {"numPublication":"3","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypePublication":"3","titre":"un titre"}]} 

of type org.json.JSONObject cannot be converted to JSONArray

The syntax of my result is simple :

{"Object1":[{"id":"value"},{"id":"value"}],
 "Object2":[{"id":"value"},{"id":"value"}],
 ...
}

My JAVA script for the extraction (ligne error : with an **):

result=sb.toString();
**JSONArray jArray = new JSONArray(result);**
for (int i=1;i<=9;i++){
    JSONObject typeUpdateObject = jArray.getJSONObject(i);
    extraction(typeUpdateObject, i);
}

This is not the right method for this extraction ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:47:10+00:00Added an answer on May 24, 2026 at 8:47 am

    The answers by Chris and Charles are correct and you should look over the JSON specification. That said, I believe the following is what you’re looking for.

    JSONObject obj = new JSONObject(result);
    for(int i=1;i<=9;i++) {
        JSONArray arr = obj.getJSONArray(""+i);
        for(int j=0;j<arr.length();j++)
            extraction(arr.getJSONObject(j), i);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have a php script that fetches data from a DB, the result set
I have a problem using JSON and arrays. Here is my code: while($row =
I have a problem accessing JSON data. I'm new to JSON and jquery so
I have problems returning JSON data after using Uploadify. This code works in Firefox,
I am getting this output of json by doing this $.get('getDataPartySize.php', function(data) { alert(data);
i have following json format { status: ACTIVE, result: false, isworking: false, margin: 1,
Hi i have a problem i'm not able to solve. In my Android\java application
I have problem with JSON, passing html code, I don't understand because I escaped
i have a page made AJAX/HTTP Request and the result is JSON formatted .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.