Note that there are some explanatory texts on larger screens.

plurals
  1. POrequest and response in iPhone to php decreases speed
    primarykey
    data
    text
    <p>I'm using php files to get data from mysql to iPhone app, to illustrate my mean I used this code in php </p> <pre><code>&lt;?php $host = "localhost"; $user_name = "user_name"; $password = "password"; $db_name = "db_name"; $con = mysql_connect($host,$user_name,$password)or die (mysql_error()); mysql_select_db($db_name)or die (mysql_error()); mysql_query("set names utf8"); $SQL= "SELECT * FROM emails WHERE 1"; $RS = mysql_query($SQL) or die(mysql_error()); mysql_query("set character_set_server='utf8'"); while($row=mysql_fetch_assoc($RS)) $output[]=$row; $json_encode =json_encode($output); $utf8_decode = utf8_decode($json_encode); echo $json_encode; mb_convert_encoding($json_encode, 'UTF-8'); $html_entity_decode = html_entity_decode($json_encode); </code></pre> <p>?></p> <p>and in iPhone I used this code:</p> <pre><code>NSString *phpUrl = @"url of my php file"; SBJsonParser *parser = [[SBJsonParser alloc] init]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:phpUrl]]; NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding]; NSArray *statuses = [parser objectWithString:json_string error:nil]; for (NSDictionary *status in statuses) { NSString *sEmailID = [status objectForKey:@"ID"]; NSString *sEmail = [status objectForKey:@"Email"]; NSString *sPassword = [status objectForKey:@"Password"]; NSString *sSMTP = [status objectForKey:@"SMTP"]; } </code></pre> <p>and this works ok for me and I got my data. I also uses this way many times in my app. But my problem is that the request and response leads to decrease the speed of my app and made it works so slowly. Is there are any ways to decrease the speed of request and response or is there are any alternative ways instead of this? Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload