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 8608649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:40:08+00:00 2026-06-12T03:40:08+00:00

I have developed a webservice in PHP. It uses the MySQL database. In this,

  • 0

I have developed a webservice in PHP. It uses the MySQL database. In this, I have used JSON. I want to fetch data from this webservice in my iPhone app. I have used a function which has one parameter. How can I use this in the iPhone?

Webservice:

<?php

echo getdata($_REQUEST['lastupdate']);

function getdata($lastupdatedate){

    $json = '{"foo-bar": 12345}';



    $obj = json_decode($json);

    //print $obj->{'foo-bar'}; // 12345



    $con = mysql_connect("localhost","un","pwd");



    if (!$con)



    {



    die('Could not connect: ' . mysql_error());



    }

    //print_r($con);



    mysql_select_db("roster", $con);







    $query = "select * from rates where LastUpdated = '".$lastupdatedate."' order by LastUpdated limit 1";

    $rs = mysql_query($query) or die($query);

    //print_r($rs);

    while($row=mysql_fetch_assoc($rs)){

    $record[] = $row;

    }



    $data = json_encode($record);



    header('Cache-Control: no-cache, must-revalidate');

    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');

    header('Content-type: application/json');

    return $data;

}

?>

I am requesting the URL: http://domain/t1.php?lastupdate=2012-09-01 01:00:00.

  • 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-12T03:40:10+00:00Added an answer on June 12, 2026 at 3:40 am

    You would create an request for http://domain/t1.php?lastupdate=2012-09-01 01:00:00 and then parse your response JSON.

    Depending on how your code should function (onload or based on some user action) your code should function similar to this example from raywenderlich.com

    Basic code snippets:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        dispatch_async(kBgQueue, ^{
            NSData* data = [NSData dataWithContentsOfURL:yourURLValue];
            [self performSelectorOnMainThread:@selector(fetchedData:) 
              withObject:data waitUntilDone:YES];
        });
    }
    
    - (void)fetchedData:(NSData *)responseData {
        //parse out the json data
        NSError* error;
        NSDictionary* json = [NSJSONSerialization 
            JSONObjectWithData:responseData //1
    
            options:kNilOptions 
            error:&error];
    
        NSArray* JSONResultValues = [json objectForKey:@"yourKey"]; //2
    
        NSLog(@"Results: %@", JSONResultValues); //3
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a HTML application which uses JQuery to get the data from
Previously i have used restful wcf webservices to get the data from server.But now
I have developed WebService using Restlet API in Java for iPhone/iPad devices. Our server
We have developed a webservice based on Apache CXF . This is working fine
I have developed a Webservice using Axis2 , made a .aar file from it
I have developed android application named VMS.I have to get messages from the webservice.The
I have developed a WCF WebService. On client side they are unable to send
I have developed a web app using a webservice. Everything works fine in the
I have developed a Web service using WCF Service Application. This service application is
My Situation I have developed a web service for document analysis This web service

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.