|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
#include <stdio.h>
#include <stdlib.h> #include "mysql.h" MYSQL mysql; MYSQL_RES *res; MYSQL_ROW row; void exiterr(int exitcode) { fprintf( stderr, "%sn", mysql_error(&mysql) ); exit( exitcode ); } int main() { uint i = 0; if (!(mysql_connect(&mysql,"host","username","password"))) exiterr(1); if (mysql_select_db(&mysql,"ksedata")) exiterr(2); if (mysql_query(&mysql,"SELECT name,rate FROM emp_master")) exiterr(3); if (!(res = mysql_store_result(&mysql))) exiterr(4); while((row = mysql_fetch_row(res))) { for (i=0 ; i < mysql_num_fields(res); i++) printf("%sn",row[i]); } if (!mysql_eof(res)) exiterr(5); mysql_free_result(res); mysql_close(&mysql); } *************************************** when i compile following code theser error messages come undefined reference error mysql_connect(...) undefined reference error mysql_bin(..) etc... whats wrong either my gcc is not link whith client side lib or something else? thanks in advance.. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > whats wrong in my code or compile method my code is here? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|