i am creating a register and login form in XCode.. have four textfields 1. nameText 2. MessageText 3. emailidText 4. passwordText
it was running good when i have first 2 fields and when i added emailid and password TExts, mysql database table is updated like all textfields in one cell.for Example
- nameText - selva
- MessageText - hello
- emailidText - abc@abc.com
- passwordText - xxxxxx
it update like selva?message=hello?emailid=abc@abc.com?password=xxxxxx on the name cell and rest of the 3 cells in table are empty...
i checked my PHP by creating HTML file and linked to it, it is working very fine. NOTE: i am working on online HOSt and online MYSQL database....
this is what i am declared in my viewcontroller.m
-(void)postMessage:(NSString*) message withName:(NSString *) name withName: (NSString*)emailid withName:(NSString *)password
{
if (name !=nil && message != nil && emailid !=nil && password !=nil)
{
NSMutableString *postString = [NSMutableString stringWithString:kpostURL];
[postString appendString:[NSString stringWithFormat:@"?%@=%@", kName, name]];
[postString appendString:[NSString stringWithFormat:@"?%@=%@", kMessage, message]];
[postString appendString:[NSString stringWithFormat:@"?%@=%@", kemailid, emailid]];
[postString appendString:[NSString stringWithFormat:@"?%@=%@", kpassword, password]];
[postString setString:[postString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSMutableURLRequest *request=[[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:postString]];
[request setHTTPMethod:@"POST"];
postConnection =[[ NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
}
}
-(IBAction)post:(id)sender
{
[self postMessage:messageText.text withName:nameText.text withName:emailidText.text withName:passwordtext.text];
passwordtext.text= nil;
messageText.text= nil;
nameText.text = nil;
emailidText.text=nil;
}
created macros in viewcontroller.h and declared the four fields too..
i dont know why i am getting my o/p of all the four fields in one cell??
can anyone help me to clear my error please..