Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db = [[MCPConnection alloc] initToHost:@"host" withLogin:@"username" usingPort:3306];
- [db setPassword:@"password"];
- NSLog(@"Connect: %d", [db connect]);
- BOOL connSuccessful = [db connect];
- if (!connSuccessful) {
- NSLog(@"%@",[db getLastErrorMessage]);
- }
- else {
- BOOL selectDBSuccessful = [db selectDB:@"database"];
- if (!selectDBSuccessful) {
- NSLog(@"%@",[theConn getLastErrorMessage]);
- }
- else {
- // MySQL Stuff Here
- }
- }
Add Comment
Please, Sign In to add comment