Make C MySQL code work with bdSociete DB.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 8 Jan 2018 10:23:40 +0000 (11:23 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 8 Jan 2018 10:23:40 +0000 (11:23 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TD5/C/Makefile
TD5/C/exemple_mysql_libmysqlclient.c

index eb1c6862958879ff0e5a6402ac5e4f7928d6a616..7f5ffe9ebdd69666a9722d5dfebf92995e1081b7 100644 (file)
@@ -11,7 +11,7 @@
 #
 # Automatic dependencies code from:
 # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr
-BINARY_NAME=infovols
+BINARY_NAME=liste_usines
 BUILD_TYPE=debug
 #BUILD_TYPE=release
 LDLIBS=-lmysqlclient
index 9f26acc586ba1eb3c50a1530eaf2632ac3740048..9dcc636bfe608b265fb7e72fd5a3db8a98e2f348 100644 (file)
@@ -4,7 +4,7 @@
 
 //il faut : libmysqlclient-dev
 
-//compilation : 
+//compilation :
 // gcc testsqlc.c -o testsqlc -I/usr/include/mysql -lmysqlclient -L/usr/lib64/mysql
 
 //execution :
@@ -17,10 +17,10 @@ int main(void)
        MYSQL_ROW row;
        MYSQL_RES *result;
 
-       char *server = "";
-       char *user = "";
+       char *server = "localhost";
+       char *user = "fraggle";
        char *password = "";
-       char *database = "";
+       char *database = "bdSociete";
 
        conn = mysql_init(NULL);