I'm trying to integrate the MCPKit MySQL framework available at http://mysql-cocoa.sourceforge.net/ into my cocoa application. I've added the framework and included the header file but when I try to define my first MCPConnection variable it says "MCPConnection undeclared". Is anyone successfully using MCPKit on leopard ? Or is there another framework that people use to access MySQL ?
Ok, I've managed to get the framework working but I'm having trouble getting results back. When I perform a query with more than one field I cannot access the results properly.
This works:
result = [db queryString:@"select Title from newsitems LIMIT 10"];
row = [result fetchRowAsDictionary];
NSLog(@"%@", [row objectForKey:@"Title"]);
This does not:
result = [db queryString:@"select Title, Link from newsitems LIMIT 10"];
row = [result fetchRowAsDictionary];
NSLog(@"%@", [row objectForKey:@"Title"]);
NSLog(@"%@", [row objectForKey:@"Link"]);
When I try the second example, Title correctly outputs as a string, but Link outputs "0" instead of the string (both are defined in mysql as varchars). It seems whenever I try to get multiple fields into a NSDictionary, only the first one works. Any idea why ?
Some one please help me in adding procedure of Mcpkit framework to iphone application i m totally disappointed regarding this
I wrote a guide on how to get MCPKit up and running on XCode 3.2.x :) People from Sequel Pro gave me a copy of the MCPKit they used, which is a bit updated from the ones you can find floating around google.
P.S. I couldn't post a link to Sequel Pro because this is my first post. -_-;;
Best,
-R