SMySQL Problems
SMySQL Problems
- Subject: SMySQL Problems
- From: Syphor <email@hidden>
- Date: Thu, 10 Oct 2002 12:48:32 +1000
Hi all,
I'm building a cocoa program in Objective C and I'm using the
SMySQL framework to interact with my mysql server. Though I am having
some problems.
This is my database:
Name: Test DB
-------------
Table Name: TestTable
+----------+------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------+------+-----+---------+-------+
| TestText | text | YES | | NULL | |
+----------+------+------+-----+---------+-------+
All Values in: TestTable
+----------+
| TestText |
+----------+
| Test |
+----------+
----------------------------
My Cocoa App code for conecting an getting a result:
[code]
- (void)getResult
{
/* MySQL Connection */
SMySQLConnection *msqlConnection = [[SMySQLConnection alloc]
initToHost:@"localhost" withLogin:@"syphor" password:@"syphor"
usingPort:3306];
NSDictionary *theDict = [[[NSDictionary alloc] init] autorelease];
SMySQLResult *theResult = [[[SMySQLResult alloc] init] autorelease];
NSArray *theFields = [[[NSArray alloc] init] autorelease];
/* Select the db */
[msqlConnection selectDB:@"Testdb"];
theResult = [msqlConnection queryString:@"select * from TestTable"];
theFields = [theResult fetchFieldsName];
theDict = [theResult fetchRowAsDictionary];
NSLog(@"Result - %@", [theDict objectForKey:[theFields
objectAtIndex:0]]);
}
[/code]
------------
The Result I get is:
[code]
Result - <54657374 >
[/code]
Anyone got any ideas how to get the right result??
_______________________________________________
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.