title: How to get data (select's lines) from web service to xcode?
body: <p>I want to get all the results of a sql table's call (select *) in php, to send them to the iphone's app and use them there.</p>
  
  <p>What steps would you recommend me?</p>
  
  <p>I am a complete noob in xcode and php. I have some tests like this one:</p>
  
  <pre><code>   NSString *miURL = [NSString stringWithFormat:@"http://hello.com/test.php];
  
     NSString *myRawJson = [[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:miURL]];
  
  
     SBJsonParser *parser = [[SBJsonParser alloc] init];
  
     NSArray *list = [NSArray alloc];
     lista = [[parser objectWithString:myRawJson error:nil] copy]; 
  </code></pre>
  
  <p>And in the .php:</p>
  
  <pre><code>    &lt;?php
          $conectID = mssql_connect("SERVIDOR\SQLEXPRESS","**","**");
          mssql_select_db("Animals");
  
          $result=mssql_query("select * from dbo.animals where name='jack'");
          $row=mssql_fetch_array($result);
  
          if ($row){
              $myArray = array($row["name"], $row["type"], $row["colour"], $row["age"], $row["address"]);
              echo json_encode($myArray); 
  </code></pre>
  
  <p>}</p>
  
  <p>All of this is good and quick for a simple line.. but for a lot of lines from a sql's select would be very inefficient, doesn't it? 
  Because I would like to execute for example: "select * from dbo.animals" and save each field of the table in its counterpart xcode's object's field. In xcode I would have a list of this:</p>
  
  <pre><code>    @interface DataPerfil : NSObject {    
         NSString *name;
         NSString *type;
         NSString *colour;
         NSInteger *age;           
         NSString *address;    
      }
      ....
  </code></pre>
  
  <p>I hope I have explained it well..</p>
  
  <p>Sorry my bad english and thanks.</p>