MySQL Error
#1

I got an error after I updated to new MySQL plugin. How do I fix this?

undefined symbol "mysql_ping"

Код:
stock ConnectMySQL()
{
	dbHandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
	mysql_debug(1);
	if(mysql_ping() == -1)
	{
	    printf("Failed to connect to MySQL !");
	} else {
		printf("Connected to MySQL !");
	}
	return 1;
}
Reply
#2

Quote:
Originally Posted by Jennifer
Посмотреть сообщение
I got an error after I updated to new MySQL plugin. How do I fix this?

undefined symbol "mysql_ping"

Код:
stock ConnectMySQL()
{
	dbHandle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
        if(mysql_errno() == -1)  printf("Failed to connect to MySQL !");
	else   printf("Connected to MySQL !");
	return 1;
}
The above should do it. I shrunk your if-then-else statement too. I pulled the mysql_debug() too as it is no longer in the newer versions. That is mysql_log.
Reply
#3

Made it work, thanks a lot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)