Mac Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsMac Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 9th, 2007, 03:24 AM
issamneo's Avatar
issamneo issamneo is offline
a matrix member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Tunisia
Posts: 170 issamneo User rank is Lance Corporal (50 - 100 Reputation Level)issamneo User rank is Lance Corporal (50 - 100 Reputation Level)issamneo User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 12 h 26 m 11 sec
Reputation Power: 5
Problem = cocoa + framework smysql

hi all,
i'm trying to connect on a distant mysql DB using cocoa and the frameworks smysql. the code we copy/paste (with some modification) it from the sourceforge project cocoamysql, when we test the project everything is ok, when we try our code that we get from the project it shows error.
this is the code:
Code:
+ (NSDictionary *)setConnection {

    NSAutoreleasePool        *pool = [[NSAutoreleasePool alloc] init];
    //MCPConnection            *connection, *connect2, *mySQLConnection;
    //MCPResult                *result;
    NSArray                    *names, *types;
    NSDictionary            *row;
    unsigned int            count, i, code;
   char                 *aBigIntegerAsString = "18446744073709551612";

    NSLog(@"A big integer (64b required) : string : %s, as integer (using strtoull) : %llu, NSNumber :%@", aBigIntegerAsString, strtoull(aBigIntegerAsString, NULL, 0), [MCPNumber numberWithUnsignedLongLong:strtoull(aBigIntegerAsString, NULL, 0)]);
   printf("The value of the strtoull functions is : %llu\n\n", strtoull(aBigIntegerAsString, NULL, 0));
   printf("The value of the strtoll functions is : %lli\n\n", strtoll(aBigIntegerAsString, NULL, 0));
   NSLog(@"And now, the NSNumber again, but this time asking for the unsigned value : %llu", [[MCPNumber numberWithUnsignedLongLong:strtoull(aBigIntegerAsString, NULL, 0)] unsignedLongLongValue]);

    connection = [[MCPConnection alloc] initToHost:@"localhost" withLogin:@"root" password:@"root" usingPort:8889];
    [connection selectDB:@"coiffure_tv"];
    
    mySQLConnection = [[MCPConnection alloc] initToHost:"localhost"
                                    withLogin:"root"
                                    password:"root"
                                    usingPort:8889];
    
    if ( ![mySQLConnection isConnected] )
            code = 2;
            else code = 1;
    NSLog (@"Resultat Connection : \n%s", connection);
    result = [connection queryString:@"SELECT * FROM Videos"];
    count = [result numOfFields];
    NSLog (@"Resultat requette : \n%d", count);
    names = [result fetchFieldsName];
    types = [result fetchTypesAsArray];

    [connection release];
    connect2 = [[MCPConnection alloc] init];
   //[connect2 setConnectionOption:CLIENT_SSL toValue:NO];
   [connect2 connectWithLogin:@"root" password:@"root" host:@"localhost" port:8889 socket:nil];
   [connect2 selectDB:@"coiffure_tv"];
   result = [connect2 listTables];
   NSLog (@"Using connect2 : Here is the NSLog of a MCPResult (listTables) : \n%@", result);
   result = [connect2 queryString:@"select * from Videos"];
   NSLog (@"Using connect2 : content of table Videos : \n%@", result);
   NSLog (@"Here comes the last error information : %@\n", [connect2 getLastErrorMessage]);
   [connect2 release];
    [pool release];
    //return [NSNumber numberWithInt:(count)];
    return [NSNumber numberWithInt:(code)];
}


and this is the error:
Code:
Building ZeroLink launcher /Users/imac/connect_mysql/build Debug/connect_mysql.app/Contents/MacOS/connect_mysql (1 warning)

warning /Users/imac/connect_mysql/SMySQL_static.framework SMySQL_static cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
__________________
THE MATRIX HAS YOU

-------------------------------
end transmission
-------------------------------

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsMac Help > Problem = cocoa + framework smysql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway