Jump to content
  • 0

Conexiune


AdY.Capone

Question

Problema intalnita (descriere):nu stiu sa fac conexiunea in myacc.inc a serverului redinforce
Ero(area / rile) / warning-(ul / urile):Nu sunt
Liniile de cod / sursa / script-ul(obligatoriu):

// MySQL
#undef MAX_PLAYERS
#define MAX_PLAYERS 200

#define mysql_host "93.119.26.250" // 93.119.26.250/phpmyadmin
#define mysql_user "user"
#define mysql_password "pw"
#define mysql_database "database"

#define mysql_host1 "93.119.26.250" // 93.119.26.250/phpmyadmin
#define mysql_user1 "user"
#define mysql_password1 "pw"
#define mysql_database1 "user=database"


new handle;
new gQuery[512];
new mysqlstatus = 0;
new MySQLSelect = 1;   ///// Aici puteti pune 1 sau 2 gen sus la mysql_host sa fie localhost ( pe pc tau) si mysql_host1 sa fie hostu real.

forward MySQLConnect();

public MySQLConnect()
{
    new read[64];
    new File:file = fopen("startup.txt", io_read);
    if(file)
    {
        fread(file, read);
        fclose(file);
        MySQLSelect = strval(read);
    }
    if(MySQLSelect == 0) handle = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
    else if(MySQLSelect == 1) handle = mysql_connect(mysql_host1, mysql_user1, mysql_database1, mysql_password1);
    return 1;
}

Imagini / Video (optional):In loc de user pw si database am completat cu datele phpmyadmin.. dar nu merge. Am uploadat si baza si tot asa apare

[13:42:52] [MySQL]: Connection to database (rif) failed!

database nu se numeste rif. Am pus ca la host si am modificat ex. zp_hid.sql si in fisierul acela la database`rif` am pus database `zp_hid`
Ati incercat sa rezolvati singur?:Da, dar nu merge.. apare rif si in gamemode nu exista.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Incearca asa:

 // MySQL
#undef MAX_PLAYERS
#define MAX_PLAYERS 200

#define mysql_host "localhost" // 93.119.26.250/phpmyadmin
#define mysql_user "root"
#define mysql_password ""
#define mysql_database "numelebazeidedate"// editezi aici cu ce ai tu ...

#define mysql_host1 "localhost" // 93.119.26.250/phpmyadmin
#define mysql_user1 "root"
#define mysql_password1 ""
#define mysql_database1 "numelebazeidedate"// editezi aici cu ce ai tu ...


new handle;
new gQuery[512];
new mysqlstatus = 0;
new MySQLSelect = 1;   ///// Aici puteti pune 1 sau 2 gen sus la mysql_host sa fie localhost ( pe pc tau) si mysql_host1 sa fie hostu real.

forward MySQLConnect();

public MySQLConnect()
{
    new read[64];
    new File:file = fopen("startup.txt", io_read);
    if(file)
    {
        fread(file, read);
        fclose(file);
        MySQLSelect = strval(read);
    }
    if(MySQLSelect == 0) handle = mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
    else if(MySQLSelect == 1) handle = mysql_connect(mysql_host1, mysql_user1, mysql_database1, mysql_password1);
    return 1;
} 

 

 

 

Link to comment
Share on other sites

  • 0

Intră în fișierul startup.txt din scriptfiles și specifică ce valoare este scrisă în el.

startup.txt

În funcție de acea valoare se vor face configurările.

 

Edited by HtP
Link to comment
Share on other sites

  • 0

Dacă ai pus 1 folosești (editezi) aceste macroinstructiuni:

#define mysql_host1 "localhost" // 93.119.26.250/phpmyadmin
#define mysql_user1 "root"
#define mysql_password1 ""
#define mysql_database1 "numelebazeidedate"// editezi aici cu ce ai tu ...

și le înlocuiești cu datele tale.

 

Da, gamemode-ul trebuie recompilat după salvarea fisierului myacc.inc. 

Edited by HtP
  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.