02.02.2014, 12:36
mysql_connect returns the connection handle, if you want to check whether the connection was successful or not, use mysql_errno:
It returns 0 when no errors; therebefore the connection did not fail.
pawn Код:
SQL_db = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
if (!mysql_errno(SQL_db)) printf("MySQL connection successful");
else printf("MySQL failed to connect");