28.01.2017, 01:25
Quote:
R41-2 code
Code:
#define MYSQL_HOST "127.0.0.1" #define MYSQL_USER "root" #define MYSQL_DATABASE "databasename" #define MYSQL_PASSWORD "" mysql = mysql_connect("127.0.0.1", "root", "", "dataname"); if(mysql_errno() != 0) // checks if the server failed to connected or not { print("[MYSQL]: Failed to connect with using Following Informations: "); printf(" Host: %s | User: %s | Password: ****** | Database: %s", MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE); } else { printf("[MYSQL]: Connection Success to database: %s !", MYSQL_DATABASE); }