Guest User

Untitled

a guest
Jan 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. db = [[MCPConnection alloc] initToHost:@"host" withLogin:@"username" usingPort:3306];
  2. [db setPassword:@"password"];
  3.  
  4. NSLog(@"Connect: %d", [db connect]);
  5. BOOL connSuccessful = [db connect];
  6. if (!connSuccessful) {
  7. NSLog(@"%@",[db getLastErrorMessage]);
  8. }
  9. else {
  10. BOOL selectDBSuccessful = [db selectDB:@"database"];
  11. if (!selectDBSuccessful) {
  12. NSLog(@"%@",[theConn getLastErrorMessage]);
  13. }
  14. else {
  15. // MySQL Stuff Here
  16. }
  17. }
Add Comment
Please, Sign In to add comment