Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Suki.N

macrumors newbie
Original poster
Sep 29, 2011
4
0
I had a Objective-C program which call a Web-service method to insert data into SQL. But i failed in inserting "&" and "+". Any idea on how i can solve this problem??
 
I try to store user text message into sql. so it could be a single "&" or "&" with other text.
 
Can you show us what you're sending? Just put placeholders for the sensitive parts.
 
Last edited:
Thanks crown33.

I able to insert the user input sms into db.

Now the problem is when i input "&&&", the program successfully insert into sql. but when i retrieve the data from sql, it give me "&" only.

Any idea what is going on??

Below is my code:
Code:
‎
- (void) downloadingMessages:(NSString *)fromOpp{ 
     NSString *queryString = [NSString
     stringWithFormat:@"http://testing.com/sms_receive.asmx/receive_sms?FromPhone=%@&ToPhone%@",
     fromOpp, fromNumber];
     NSURL *url = [NSURL URLWithString:queryString];
     NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
     [req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
     [req addValue:0 forHTTPHeaderField:@"Content-Length"];
     [req setHTTPMethod:@"GET"];
     NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:req delegate:self];
     if (conn) {
            webData = [[NSMutableData data] retain];
     }
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.