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]]);
}
------------
The Result I get is:
Code:
Result - <54657374 >
Anyone got any ideas how to get the right result??