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

  • SEARCH
  • Home
  • 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 9023989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:53:49+00:00 2026-06-16T05:53:49+00:00

I am trying to print MySQL result sets with PHP in JSON format, and

  • 0

I am trying to print MySQL result sets with PHP in JSON format, and read it with iOS.

This is my JSON-string:

[{"partnerid":"1","code":"SUMU6003","partnerName":"Company name","street":"Some Street 5323","zipCode":"8732","city":"Berlin","languages":"English","workers":"Name 1, Name 2","lineup":"Kids"},{"partnerid":"2","code":"DEMO8884","partnerName":"Partner 2","street":"Third street 2","zipCode":"383838","city":"Berlin","languages":"Greek","workers":"Petra","lineup":"Kids"}]

In this method I get the NSDictionary:

#pragma mark - ServiceConnectorDelegate -

-(void)requestReturnedData:(NSData *)data { 
    NSDictionary *dictionary = [NSDictionary dictionaryWithJSONData:data];
    # process dictionary and grep strings from json-string
    # ...
}

Can you please tell me how to access the different result sets in a loop? I want to access each key separately.

I know that the NSDictionary contains data, because NSLog(@"%@",dictionary); prints:

2012-12-20 19:13:20.661 myapp[576:907] (
        {
        city = Berlin;
        code = SUMU6003;
        languages = English;
        lineup = Kids;
        partnerName = "Company name";
        partnerid = 1;
        street = "Some Street 5323";
        workers = "Name 1, Name 2";
        zipCode = 8732;
    },
        {
        city = Berlin;
        code = DEMO8884;
        languages = Greek;
        lineup = Kids;
        partnerName = "Partner 2";
        partnerid = 2;
        street = "Third street 2";
        workers = Petra;
        zipCode = 383838;
    }
)

Thank you very much for the help.

  • 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-06-16T05:53:51+00:00Added an answer on June 16, 2026 at 5:53 am

    Sometimes introspection can be useful here. For instance NSLog(@”dictionary is of type: %@”, [dictionary class]);

    The reason I say that is based on your output it appears that dictionary is in fact an array containing two NSDictionaries. If that is the case you would want to do something like this:

    for (NSDictionary *actualDictionary in dictionary<this is really an array>)
    {
      NSString *myStringValue = [actualDictionary objectForKey:@"city"];
      // etc...
    }
    

    You have to find out what data types your actually dealing with first though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to print a query result to file from MySQL ( SELECT blah
I'm trying to put an mysql query result into an string I tried to
I am trying to execute my PHP code, which calls two MySQL queries via
I'm trying to print a large string to alivepdf. I'm splitting the string by
I'm trying to print out a list of products on a page. This is
I am trying to print HTML with this JavaScript in the webview, however it
I am trying to print a particular text using awk if string is empty.
i am trying to import Mysql column in andorid column here is my php
I'm trying to display the result of an MYSQL select count as a hyperlink
I'm trying to return a count from mysql. My code is below $number_of_options_sql =

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.