hi guys i connect my server to mysql and uplode the files in myphpadmin but i have 1 problem in server logs say connection faield
Код:
forward ConnectMySQL();
public ConnectMySQL()
{
GTADM=mysql_connect("127.0.0.1","port_8008", "port_8008", "******");
//example GTADM=mysql_connect("127.0.0.1","gtaserver4279", "gtaserver4279", "maybefuckoff");
printf("%d",mysql_errno(GTADM));
if(mysql_errno() != 0)
{
mysql_close(GTADM);
printf("[MYSQL]: [ERROR]:first Connection to `DATABASE` failed!");
GTADM=mysql_connect("127.0.0.1","port_8008", "port_8008", "*****");
//example GTADM=mysql_connect("127.0.0.1","gtaserver4279", "gtaserver4279", "maybefuckoff");
printf("%d",mysql_errno(GTADM));
if(mysql_errno() != 0)
{
mysql_close(GTADM);
printf("[MYSQL]: [ERROR]:Second Connection to `DATABASE` failed!");
}
else
{
//mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
printf("[MYSQL]:second Connection to `DATABASE` successful! || %d",GTADM);
con=2;
}
}
else
{
//mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
printf("[MYSQL]:first Connection to `DATABASE` successful! || %d",GTADM);
con=1;
}
return 1;
}
Wrong.