05.06.2018, 16:38
This:
Should be,
mysql_errnno() will return -1 if there was any error. And 0 if there were no error. I sent you the link of wiki above.
PHP код:
mysql_connect("127.0.0.1", "root", "", "server");
if(mysql_errno(Database) == 0)
{
printf("[MySQL] The connection has failed.");
}
else
{
printf("[MySQL] The connection was successful.");
}
PHP код:
new MySQL:Database; //On the Top
Database = mysql_connect("127.0.0.1", "root", "", "server");
if(mysql_errno() == 0)
{
printf("[MySQL] The connection was successful.");
}
else
{
printf("[MySQL] The connection has failed.");
}