26. september 2005 - 18:04Der er
28 kommentarer og 1 løsning
Mysql connect fjernserver
Hey...
Jeg er ved at prøve at få lavet et lille stump code som connecter til en mysql databasse (ikke samme server som jeg skal køre script på) Den skal så i en tabel finde alle 'name' hvor deres 'status' er '1' og skrive det i consol, og derefter rette 'status' til '0'
Nogle der vil hjælpe mig med det så jeg kan komme vidre med at lære denne nye verden at kende !?
har fundet ud af det...men når jeg compiler får jeg en masse fejl...
Det er som om at der mangler noget mysql ting til det...
sms.cpp:5:19: mysql.h: Ingen sådan fil eller filkatalog sms.cpp: I function 'int main()': sms.cpp:16: error: `MYSQL' undeclared (first use this function) sms.cpp:16: error: (Each undeclared identifier is reported only once for each function it appears in.) sms.cpp:16: error: `handle' undeclared (first use this function) sms.cpp:16: error: `mysql_init' undeclared (first use this function) sms.cpp:19: error: `cerr' undeclared (first use this function) sms.cpp:19: error: `mysql_error' undeclared (first use this function) sms.cpp:19: error: `endl' undeclared (first use this function) sms.cpp:22: error: `mysql_real_connect' undeclared (first use this function) sms.cpp:28: error: `mysql_query' undeclared (first use this function) sms.cpp:29: error: `MYSQL_RES' undeclared (first use this function) sms.cpp:29: error: `result' undeclared (first use this function) sms.cpp:29: error: `mysql_store_result' undeclared (first use this function) sms.cpp:31: error: `mysql_num_fields' undeclared (first use this function) sms.cpp:32: error: `MYSQL_ROW' undeclared (first use this function) sms.cpp:32: error: tolkningsfejl before `;' token sms.cpp:33: error: `row' undeclared (first use this function) sms.cpp:33: error: `mysql_fetch_row' undeclared (first use this function) sms.cpp:34: error: `mysql_fetch_lengths' undeclared (first use this function) sms.cpp:39: error: `cout' undeclared (first use this function) sms.cpp:45: error: `mysql_free_result' undeclared (first use this function) sms.cpp:47: error: `mysql_close' undeclared (first use this function)
sms.cpp: I function 'int main()': sms.cpp:19: error: `cerr' undeclared (first use this function) sms.cpp:19: error: (Each undeclared identifier is reported only once for each function it appears in.) sms.cpp:19: error: `endl' undeclared (first use this function) sms.cpp:39: error: `cout' undeclared (first use this function)
det fjernet dem...men så kome der bare en masse andre !
/tmp/ccyQLVPg.o(.text+0x19): In function `main': : undefined reference to `mysql_init' /tmp/ccyQLVPg.o(.text+0x2d): In function `main': : undefined reference to `mysql_error' /tmp/ccyQLVPg.o(.text+0xae): In function `main': : undefined reference to `mysql_real_connect' /tmp/ccyQLVPg.o(.text+0xbd): In function `main': : undefined reference to `mysql_error' /tmp/ccyQLVPg.o(.text+0x10e): In function `main': : undefined reference to `mysql_query' /tmp/ccyQLVPg.o(.text+0x119): In function `main': : undefined reference to `mysql_store_result' /tmp/ccyQLVPg.o(.text+0x127): In function `main': : undefined reference to `mysql_num_fields' /tmp/ccyQLVPg.o(.text+0x135): In function `main': : undefined reference to `mysql_fetch_row' /tmp/ccyQLVPg.o(.text+0x14e): In function `main': : undefined reference to `mysql_fetch_lengths' /tmp/ccyQLVPg.o(.text+0x296): In function `main': : undefined reference to `mysql_free_result' /tmp/ccyQLVPg.o(.text+0x2a1): In function `main': : undefined reference to `mysql_close' collect2: ld returnerede afslutningskoden 1
ja..... det er dem her ikke... gcc -I/usr/include/mysql query.c /usr/lib/mysql/libmysqlclient.a -lz -o query gcc -I/usr/include/mysql insert.c /usr/lib/mysql/libmysqlclient.a -lz -o insert
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.