melvinzm Posted May 14, 2014 Report Share Posted May 14, 2014 Nick: meLvinProblema: Folosesc gamemodul Blown postat aici , dar cand incerc sa conectez serverul zice ca sa conectat dar defapt nu se conecteazaErori / warnings: - Lini/script: -Ai incercat sa rezolvi singur ?: da[pawn]if(mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS)&& mysql_errno() != 0) { printf("[MYSQL]: Conectare la `%s` a avut succes!",SQL_DB);[/pawn]Asa arata linia , am incercat si cu errno 1 si la fel . Acum ceva timp mi l.a rezolvat Woops si adaugase ceva cu new handle. Codul arata asa: [pawn]/*=================[Callbackuri + Forwarduri + Stockuri]====================*/forward Sfaturi();forward ConnectMySQL();public ConnectMySQL(){ if(mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS)&& mysql_errno() != 0) { printf("[MYSQL]: Conectare la `%s` a avut succes!",SQL_DB); } else { printf("[MYSQL]: [ERROR]: Conectare la `%s` a esuat!",SQL_DB); } return 1;}[/pawn]In log imi apare in felul urmator: [14:49:20] [MYSQL]: Conectare la `blown` a avut succes![14:49:20] * Case citite: 0[14:49:20] * Canale IRC citite: 10[14:49:20] * Character killuri citite: 10[14:49:20] * Ziare citite: 10[14:49:20] * Bizzuri citite: 0[14:49:20] * SBizzuri citite: 0[14:49:20] * Teritorii citite: 0[14:49:21] * Seifuri citite: 0[14:49:21] * Masini personale citite: 0[14:49:21] * DealerShips citite: 4[14:49:21] * ID = 0 | Factiune = 0 | Alianta = 0[14:49:21] * ID = 0 | Factiune = 0 | Alianta = 0[14:49:21] * ID = 0 | Factiune = 0 | Alianta = 0[14:49:21] * ID = 0 | Factiune = 0 | Alianta = 0[14:49:21] * ID = 0 | Factiune = 0 | Alianta = 0[14:49:21] * ID = 0 | Factiune = 0 | Alianta = 0[14:49:21] * Pickup-uri citite: 45Si daca incerc sa ma inregistrez tot zice sa te inregistrezi in continuare. Link to comment Share on other sites More sharing options...
CrystyXSR Posted May 14, 2014 Report Share Posted May 14, 2014 nu conectezi bine baza de date 93.119.26.23:7777 Link to comment Share on other sites More sharing options...
WopsS Posted May 14, 2014 Report Share Posted May 14, 2014 Fai o variabila handle.Uite un exemplu.[pawn]new handle = mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS);[/pawn]Iar la acel if pui handle && mysql_errno(handle) == 0 daca ai plugin-ul pe R8+. Daca nu pui == 1 Link to comment Share on other sites More sharing options...
Gawitkkk Posted May 14, 2014 Report Share Posted May 14, 2014 Salut, mai mult ca sigur nu ai editat datele de conectare la mysql.Modifica:#define SQL_HOST "localhost"#define SQL_USER "root"#define SQL_PASS ""#define SQL_DB "blown"Si la database pune numele cum ai tu trecut pe localhost sau pe host. Link to comment Share on other sites More sharing options...
CllawSs Posted May 15, 2014 Report Share Posted May 15, 2014 Iti trebuie o variabila pentru a tine minte conectarea la baza de date, iar acea variabila o folosesti.[pawn]new loginmysql;forward ConnectMySQL();public ConnectMySQL(){ loginmysql = mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS); if(loginmysql) { printf("[MYSQL]: Conectare la `%s` a avut succes!",SQL_DB); } else { printf("[MYSQL]: [ERROR]: Conectare la `%s` a esuat!",SQL_DB); } return 1;}[/pawn] Link to comment Share on other sites More sharing options...
Ph0eniX Posted May 20, 2014 Report Share Posted May 20, 2014 Topic inchis , 48h+ fara reply. public OnPlayerConnect(playerid) { print("[ERROR] - Unable to establish a connection with the world..."); SendRconCommand("exit"); return 1; } Link to comment Share on other sites More sharing options...
Question
melvinzm
Nick: meLvin
Problema: Folosesc gamemodul Blown postat aici , dar cand incerc sa conectez serverul zice ca sa conectat dar defapt nu se conecteaza
Erori / warnings: -
Lini/script: -
Ai incercat sa rezolvi singur ?: da
[pawn]if(mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS)&& mysql_errno() != 0)
{
printf("[MYSQL]: Conectare la `%s` a avut succes!",SQL_DB);[/pawn]
Asa arata linia , am incercat si cu errno 1 si la fel .
Acum ceva timp mi l.a rezolvat Woops si adaugase ceva cu new handle.
Codul arata asa:
[pawn]/*=================[Callbackuri + Forwarduri + Stockuri]====================*/
forward Sfaturi();
forward ConnectMySQL();
public ConnectMySQL()
{
if(mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS)&& mysql_errno() != 0)
{
printf("[MYSQL]: Conectare la `%s` a avut succes!",SQL_DB);
}
else
{
printf("[MYSQL]: [ERROR]: Conectare la `%s` a esuat!",SQL_DB);
}
return 1;
}[/pawn]
In log imi apare in felul urmator:
Si daca incerc sa ma inregistrez tot zice sa te inregistrezi in continuare.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts