Hi i am trying to create a login and password for my app by using SQLite,, every thing is fine but the once the login button is pressed it is not entering in to home page!!!!

please find my code below:

```
-(void)checkindatabase{

    NSArray *dirPath =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *docDir =[dirPath objectAtIndex:0];
    NSString *databasePath =[[NSString alloc] initWithString:[docDir stringByAppendingPathComponent:@"login.db"]];

    if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK)
    {
        NSLog(@"open");
        NSString *sql = [[NSString alloc] initWithFormat:@"select * from UserInformation where Username='%@' and Password='%@'",loginName.text,password.text];        //[sql UTF8String];
        //NSLog(@"'%s'",[sql UTF8String]);
        sqlite3_stmt *statement;
            if (sqlite3_prepare_v2(database, [sql UTF8String], -1, &statement, NULL) == SQLITE_OK)
            {   if(sqlite3_step(statement) == SQLITE_ROW)
            { 
                //user name is correct
                //if u want to print in log use below code  
                homepage *hvc = [[homepage alloc]initWithNibName: nil bundle: nil];
                hvc.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
                [self presentModalViewController:hvc animated: YES];

            }
            else {   
                UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Login Failed!!!"
                                                                message:@"Check your PId and Password" delegate:nil 
                                                      cancelButtonTitle:@"OK" otherButtonTitles:nil];
                [alert show];

                }}            

        sqlite3_finalize(statement);

    }
    sqlite3_close(database);
}
-(IBAction)homePage: (id)sender
{
    [self checkindatabase];

} 

```