Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gosselic

macrumors newbie
Original poster
Oct 8, 2008
3
0
Hey folks,

First time post - fairly simply question. I have been programming on OS/X for a little while now and ready to start coding my first major project. There is a known bug in the ODBC Administrator app and using the MySQL ODBC 5.1 or 3.51 driver and I've been searching around online for an API to use - rather than having to re-invent the wheel....

I've found a few links about a MySQL Objective C API - however I haven't been able to get the examples to work so far...

Question is... Anyone have any experience coding on XCode 3 and MySQL? Any thoughts/suggestions to make on where to get a little more clarification? I figured instead of spinning my wheels for 'x' more hours... I figured I would ask the collective brains of the Mac community :)

Thanks ahead of time for any responses!
 

gosselic

macrumors newbie
Original poster
Oct 8, 2008
3
0
So it does work then? I have tried a few times and keep running into issues. As long as someone got it to work on XCode 3.1, I'll keep fiddling away.
 

garethlewis2

macrumors 6502
Dec 6, 2006
277
1
Just write your own, it's what I did.

Yes it is tedious, but that OS project is ancient.

Unless you need all the features of the MySQL C library, you just need to wrap 2-3 functions, and you can easily add the rest if you need them later. Believe me, it is only 2-3 functions. One to get a connection. One to perform a query. One to perform an update/delete/insert. You could even put the query and insert into one method.

If you're looking for a particular example, this link contains a very quick program covering the C API for Sqlite3 using C++. You will find the MySQL one to be just as easy.

http://freshmeat.net/articles/view/1428/

I have to admit, I have written the Objective-C version of that C++ program, but it is a total waste of time as that is what Core-Data is for.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.