• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SMySQL Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: SMySQL Problems
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: [newbie] Saving NSImage's
  • Next by Date: Re: cocoa-dev digest, Vol 2 #1352 - 14 msgs
  • Previous by thread: Re: [newbie] Saving NSImage's
  • Next by thread: Re: SMySQL Problems
  • Index(es):
    • Date
    • Thread