저는 iphone.i의 초보자입니다. 내 application.i에 대한 로그인 페이지를 만들고 싶습니다. PHP 페이지에 연결하고 mysql 데이터베이스에서 해당 데이터를 검색하는 방법을 알아낼 수 없습니다. 어느 누구도 저에게 어떻게 가는지 안내해 줄 수는 없습니다.iphone에서 mysql에 액세스하는 방법
0
A
답변
0
아이폰은 php와 mysql 사이의 연결과 어떤 관계가 있습니까?
PHP는 웹 서버에서 실행될 것입니다. 일부 컴퓨터에 아파치가 설치되어 MySQL DB에 연결됩니다. 그러면 브라우저에서 아이폰의 php 페이지에 액세스하게됩니다. 브라우저를 제공하는 것 이외에 iPhone이 어떤 부분을 가지고 있는지 확실하지 않습니다.
0
예를 들어 NSURLConnection과 함께 사용할 수있는 NSURLRequest를보고 싶을 수 있습니다. URL에 대한 GET 매개 변수.
1) 설치 연결 자체에
receivedData =[NSMutableData data];
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:url]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:20.0];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
2) 설정 위임 방법 :
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse*)response {
NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response;
if([httpResponse statusCode]==200)
[receivedData setLength:0];
else
NSLog(@"Http-Reponse %u",[httpResponse statusCode]);
// HANDLE ERROR!
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
// append the new data to the receivedData
// receivedData is declared as a method instance elsewhere
[receivedData appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
// HANDLE THE CONNECTION ERROR
// release the connection, and the data object
[connection release];
// receivedData is declared as a method instance elsewhere
[receivedData release];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
// receivedData contains the data
// convert to string:
NSLog(@"finished loading: %@",[[[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding] autorelease]);
[connection release];
[receivedData release];
}
0
당신은 인증을 노출 할 수 있습니다 당신은 들어오는 데이터에 응답 할 NSURLConnectionDelegate을 implment 수 있습니다 기능을 웹 서비스로 사용한 다음 Felix L.이 게시 한 URL로드 코드를 사용하여 웹 서비스에 대한 실제 연결을 시작하십시오.
서버에서 응답을 XML로 보내려는 경우 해당 응답을 NSXMLParser와 구문 분석합니다. 그렇지 않으면 원하는 형식으로 응답을 보내고 적절하게 구문 분석 할 수 있습니다 .
관련 문제
- 1. iPhone에서 WSDL에 액세스하는 방법
- 2. C#/WPF에서 MySQL에 액세스하는 방법
- 3. iPhone에서 SOAP 서비스에 액세스하는 방법
- 4. Objective-C : iphone에서 REST API에 액세스하는 가장 좋은 방법
- 5. iPhone에서 1 초보다 정밀한 시스템 시간에 액세스하는 방법
- 6. Java를 MySQL에 연결하는 방법?
- 7. MYSQL API를 사용하여 iPhone에서 MySQL에 직접 액세스 할 수 있습니까?
- 8. mysql에 이스케이프 문자를 삽입하는 방법
- 9. mysql에 매개 변수를 전달하는 방법
- 10. Java : MediumBlob을 MySQL에 저장하는 방법
- 11. mysql에 제약 조건을 적용하는 방법
- 12. 오라클 양식에서 mysql에 연결하는 방법
- 13. iOS : 동일한 데이터에 액세스하는 여러보기 - 액세스하는 방법?
- 14. 들어오는 SMS 세부 정보에 액세스하는 방법
- 15. iPhone에서 문자열을 분리하는 방법
- 16. iPhone에서 바코드를 표시하는 방법
- 17. iPhone에서 파일을 읽는 방법?
- 18. iPhone에서 piechart을 그리는 방법
- 19. iPhone에서 Kaleidoscope를 만드는 방법
- 20. iPhone에서 UIImagePickerControllerSourceType을 변경하는 방법
- 21. iPhone에서 UI를 차단하는 방법
- 22. iPhone에서 Eigen을 컴파일하는 방법
- 23. iphone에서 그래프를 만드는 방법
- 24. iPhone에서 MapKit을 시작하는 방법
- 25. iPhone에서 오디오를 합성하는 방법
- 26. iPhone에서 시간 비교하는 방법?
- 27. iPhone에서 알림을 설정하는 방법
- 28. iPhone에서 앱을 종료하는 방법
- 29. iPhone에서 SFTP를 수행하는 방법?
- 30. iPhone에서 트래픽을 계산하는 방법