site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com work with libmysqlclient gcc -o test test.c /usr/local/lib/mysql/libmysqlclient.dylib you have to setup mysql to authorize extern connexions from the clients but i think it's not the mailing list to post this ? #include <stdio.h> #include <stdlib.h> #include "/usr/local/mysql/include/mysql.h" #define table "yourtable" #define host "localhost" #define user "user" #define pass "pass" #define db "database" int main() { MYSQL mysql; MYSQL_RES *res; MYSQL_ROW row; int i=0; char query[50]; /* store the result from our query */ res = mysql_store_result(&mysql); /* fetch each row from our result and print it */ while((row = mysql_fetch_row(res))) { for(i=0;i<mysql_num_fields(res);i++) printf("%s\n",row[i]); } /* clean up */ mysql_free_result(res); mysql_close(&mysql); } also http://mysql-cocoa.sourceforge.net/ Best Regards -----BEGIN PLUMBER CODE BLOCK----- Version: 1.0 ¬ | | > Regards Plumber || GNU Darwin. ¬ \\\ plumber.gnu-darwin.org ¬ ¬ | | > OOP --\///\ (0)=(0) Darwin/Power Mac G4. ¬ | | > ( __ò ó__ ) The best for Fede ¬ \\\ federicafontana.it ¬ ------END PLUMBER CODE BLOCK------ -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GMU/S d+@ s: a- K+++++ PGP++++ K---- dpu s--:-- C++++ C-- B L X U++++ P+++ C-- P! L--- E+++ W+++ P! L--- N+++ o-- K+++++ ------END GEEK CODE BLOCK------ Plain, Loving, Useful, Mischievous, Brutal, Explosive, Responsible _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Multiple client stations would be able to add records and view records from different Macs, all sharing the one central MySQL server database. Sounds pretty simple, right ? /* make connection to the database */ if(!(mysql_connect(&mysql,host,user,pass))) { fprintf(stderr,"mysql_connect() Failed: %s\n",mysql_error (&mysql)); exit(1); } /* the database we will use */ if(mysql_select_db(&mysql,db)) { fprintf(stderr,"mysql_select_db() Failed: %s\n", mysql_error (&mysql)); exit(1); } /* Setup the query */ sprintf(query,"select * from %s", table); if(mysql_query(&mysql,query)) { fprintf(stderr,"mysql_query() Failed: %s\n", mysql_error (&mysql)); exit(1); } I"It's making my eyes better. And it's legal. I could walk up to the President and blow smoke in his stupid monkey face, and he'd just have to sit there groovin' on it!" Homer J Simpson, Springfield, Illinois, Massachusetts nobody knows :) This email sent to site_archiver@lists.apple.com