How to check if script succesfully connected to the mysql ?
#2

Код:
mysqL_errno(MySQL:handle = MYSQL_DEFAULT_HANDLE)
it will return 0 if there were no problems performing the MySQL operation, otherwise it will return the error code.
This is how you can use it after mysql_connect:
Код:
if (mysql_errno()) print("Failed to connect to the database."); // 0 - no errors
else print("Successfully connected to the database."); // there's an error
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)