Re: SMySQL
Re: SMySQL
- Subject: Re: SMySQL
- From: Andreas Mayer <email@hidden>
- Date: Fri, 9 Jan 2004 10:45:33 +0100
Am 08.01.2004 um 23:03 schrieb Sascha Kuehn:
does someone already play with the SMySQL framwork?
Yes.
How did you make a connection and how did you make
a select-statement?
[self setMainConnection:[[MCPConnection alloc] initToHost:@"localhost"
withLogin:@"login" password:@"pwd" usingPort:0]];
if (mainConnection) {
if (![mainConnection selectDB:@"database"]) {
NSLog(@"error opening database");
[self closeDatabase];
} else {
result = YES;
}
} else {
NSLog(@"error connecting to MySQL");
}
NSMutableString *insertQuery = [NSString stringWithFormat:@"SELECT *
FROM tablename"];
MCPResult *__attribute__((__unused__))queryResult = [mainConnection
queryString:insertQuery];
if (queryResult) {
if ([queryResult numOfRows] > 0) {
result = [queryResult fetchColAtIndex:0];
}
}
bye. Andreas.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >SMySQL (From: Sascha Kuehn <email@hidden>) |