Mysql_close()
#1

Hi,

Do i need to close mysql connection when i start but it's was not succefully?

Код:
OnGameModeInit
mysql_connect(...);
if(mysql_errno() != 0)
{
mysql_close(); ?
}
Reply
#2

nope
Reply
#3

No. In fact, closing a non-existent connection seems kinda stupid to me. I just print a console message saying whether the connection was successful or not. Perhaps, closing the server is something you could do? Assuming that you use the database for all the data that requires saving, it is an important part of the functionality of your server.

It is really up to you.
Reply
#4

just check was successfully connected to the database.
PHP код:
printf("%s"mysql_errnovariable of connection ) == ? ( "successfully connected to the database" ) : ( "failed to connect to the database" ) ); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)