I’m having a rather weird problem (I think).
The user can add a contact to a tableView and this contact also gets saved to a mysql database. (the app is interacting with a php file on my server)
The weird thing is that he seems to pick one of the added values at random and adds them to the database (sometimes the firstname, sometimes the number). The php code is definitely not the problem, I got it checked here. (Also when not doing it from the app he adds everything accordingly)
So I guess it has something to do with my code:
NSString *strURL = [NSString stringWithFormat:@"http://bladesserver/phpFile.php?name=%@",firstName];
NSString *strURL2 = [NSString stringWithFormat:@"http://bladesserver/phpFile.php?lastname=%@",lastName];
NSString *strURL3 = [NSString stringWithFormat:@"http://blades/phpFile.php?number=%@",number];
NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
NSData *dataURL2 = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL2]];
NSString *strResult2 = [[NSString alloc] initWithData:dataURL2 encoding:NSUTF8StringEncoding];
NSData *dataURL3 = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL3]];
NSString *strResult3 = [[NSString alloc] initWithData:dataURL3 encoding:NSUTF8StringEncoding]
;
NSLog(@"%@", strResult);
NSLog(@"%@", strResult2);
NSLog(@"%@", strResult3);
Btw: In the tableView the contacts get display correctly (firstname, lastname, number).
I found the solution myself, kinda obvious if you think about it: