Hey Leute,
benutze seit neustem ja MySQL, doch wenn ich mich registriert habe und relogge muss ich mich neu registrieren, habe die Datenbank accounts.sql per Navicat ja erstellt.
Mfg Larso99
Hey Leute,
benutze seit neustem ja MySQL, doch wenn ich mich registriert habe und relogge muss ich mich neu registrieren, habe die Datenbank accounts.sql per Navicat ja erstellt.
Mfg Larso99
[b]Zeige doch mal deinen SaveStock her
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) //wir überprüfen ob der Spieler überhaupt noch Connected ist und ob er nicht ein NPC ist.
{
if(GetPVarInt(playerid,"Eingeloggt") == 1) //Und hier ob er noch eingeloggt ist.
{
//Nun speichern wir die Daten in der Datenbank.
mysql_SetInt("accounts", "Level", PlayerInfo[playerid][pLevel], "Name", pName);
mysql_SetInt("accounts", "Adminlevel", PlayerInfo[playerid][pAdmin], "Name", pName);
mysql_SetInt("accounts", "Fraktion", PlayerInfo[playerid][pFraktion], "Name", pName);
mysql_SetInt("accounts", "Team", PlayerInfo[playerid][pTeam], "Name", pName);
}
}
return 1;
}
Gib mal im stock unter query
mysql_store_results();
Ein
Dann kommt dieser Error: C:\Users\Lars\Downloads\Selfmade\gamemodes\selfmade.pwn(133) : error 017: undefined symbol "mysql_store_results"
Dieser kommt 2 mal.
1. Store Result
2. Für was soll er die Ergebnisse "Aufbewahren"
Zeig evtl. deinen mysql_SetInt etc. Stock
Und welche mysql version ?
MFG Arendium
Habe alles wie hier gemacht: [ SCRIPTING ] MySQL (Installation, Zugriff, Einstellungen, Login & Register Beispiel)
Doch das geht iwie nicht. Habe die Datenbank aber die erstellt sich im Ordner auch iwie nicht? Was muss ich machen Arendium?
hast du sie hochgeladen
Sprich bei Navicat??
Also ich habe bei Navicat eine Datenbank namens "samp" gemacht und darin eine Tabelle namens "accounts", doch was dann?
Hast du bei ONPlayerDisconnect auch SavePlayer(playerid); ?
Und ansonsten schalte mal die debug Funktion ein und zeige sie und bei ongamemodeinit : mysql_debug(1);
Ja habe ich bei OnPlayerDisconnect
mysql_SetInt("accounts", "Team", PlayerInfo[playerid][pTeam], "Name", pName);
was ist pname für eine Variable?
das ist der Spielername und so definiert: new pName[MAX_PLAYER_NAME];
und
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
Du musst bei einem neuen Account erst einen neuen Eintrag erstellen...
Den erstellst du mit
INSERT INTO `Tabelle` (Eintrag1,Eintrag2,Eintrag3) VALUES (5,2,'Test')
Dann kommt dieser Error: C:\Users\Lars\Downloads\Selfmade\gamemodes\selfmade.pwn(133) : error 017: undefined symbol "mysql_store_results"
Dieser kommt 2 mal.
Es gibt auch kein store_results eher mysql_store_result
Trotzdem speixhert nix, wie bekomme ich die .sql datei in meinen ordner?
Aktivier den mysql_debug und poste dann den log beim laden/speichern
Hier die Log:
[20:40:43]
[20:40:43] ---------------------------
[20:40:43] MySQL Debugging activated (03/13/13)
[20:40:43] ---------------------------
[20:40:43]
[20:40:43] >> mysql_connect( )
[20:40:43] CMySQLHandler::CMySQLHandler() - constructor called.
[20:40:43] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp" | Username: "root" ...
[20:40:43] CMySQLHandler::Connect() - Connection was successful.
[20:40:43] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[20:40:43] >> mysql_ping( Connection handle: 1 )
[20:40:43] CMySQLHandler::Ping() - Connection is still alive.
[20:41:45] >> mysql_real_escape_string( Connection handle: 1 )
[20:41:45] CMySQLHandler::EscapeString(Larso99); - Escaped 7 characters to Larso99.
[20:41:45] >> mysql_query( Connection handle: 1 )
[20:41:45] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Name` = 'Larso99') - Successfully executed.
[20:41:45] >> mysql_store_result( Connection handle: 1 )
[20:41:45] CMySQLHandler::StoreResult() - Result was stored.
[20:41:45] >> mysql_num_rows( Connection handle: 1 )
[20:41:45] CMySQLHandler::NumRows() - Returned 0 row(s)
[20:41:45] >> mysql_free_result( Connection handle: 1 )
[20:41:45] CMySQLHandler::FreeResult() - Result was successfully free'd.
[20:41:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:41:46] CMySQLHandler::EscapeString(Larso99); - Escaped 7 characters to Larso99.
[20:41:46] >> mysql_query( Connection handle: 1 )
[20:41:46] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Name` = 'Larso99') - Successfully executed.
[20:41:46] >> mysql_store_result( Connection handle: 1 )
[20:41:46] CMySQLHandler::StoreResult() - Result was stored.
[20:41:46] >> mysql_num_rows( Connection handle: 1 )
[20:41:46] CMySQLHandler::NumRows() - Returned 0 row(s)
[20:41:46] >> mysql_free_result( Connection handle: 1 )
[20:41:46] CMySQLHandler::FreeResult() - Result was successfully free'd.
[20:43:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:43:19] CMySQLHandler::EscapeString(Larso99); - Escaped 7 characters to Larso99.
[20:43:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:43:19] CMySQLHandler::EscapeString(tommy1); - Escaped 6 characters to tommy1.
[20:43:19] >> mysql_query( Connection handle: 1 )
[20:43:19] CMySQLHandler::Query(INSERT INTO `accounts` (`Name`, `Passwort`) VALUES ('Larso99', 'tommy1')) - An error has occured. (Error ID: 1054, Unknown column 'Passwort' in 'field list')
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Level); - Escaped 5 characters to Level.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:46:46] >> mysql_query( Connection handle: 1 )
[20:46:46] CMySQLHandler::Query(UPDATE `accounts` SET `Level` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Level' in 'field list')
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:46:46] >> mysql_query( Connection handle: 1 )
[20:46:46] CMySQLHandler::Query(UPDATE `accounts` SET `Adminlevel` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Adminlevel' in 'field list')
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Fraktion); - Escaped 8 characters to Fraktion.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:46:46] >> mysql_query( Connection handle: 1 )
[20:46:46] CMySQLHandler::Query(UPDATE `accounts` SET `Fraktion` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Fraktion' in 'field list')
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Team); - Escaped 4 characters to Team.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:46:46] >> mysql_real_escape_string( Connection handle: 1 )
[20:46:46] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:46:46] >> mysql_query( Connection handle: 1 )
[20:46:46] CMySQLHandler::Query(UPDATE `accounts` SET `Team` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Team' in 'field list')
[20:48:27] >> mysql_real_escape_string( Connection handle: 1 )
[20:48:27] CMySQLHandler::EscapeString(Larso99); - Escaped 7 characters to Larso99.
[20:48:27] >> mysql_query( Connection handle: 1 )
[20:48:27] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Name` = 'Larso99') - Successfully executed.
[20:48:27] >> mysql_store_result( Connection handle: 1 )
[20:48:27] CMySQLHandler::StoreResult() - Result was stored.
[20:48:28] >> mysql_num_rows( Connection handle: 1 )
[20:48:28] CMySQLHandler::NumRows() - Returned 0 row(s)
[20:48:28] >> mysql_free_result( Connection handle: 1 )
[20:48:28] CMySQLHandler::FreeResult() - Result was successfully free'd.
[20:48:28] >> mysql_real_escape_string( Connection handle: 1 )
[20:48:28] CMySQLHandler::EscapeString(Larso99); - Escaped 7 characters to Larso99.
[20:48:28] >> mysql_query( Connection handle: 1 )
[20:48:28] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Name` = 'Larso99') - Successfully executed.
[20:48:28] >> mysql_store_result( Connection handle: 1 )
[20:48:28] CMySQLHandler::StoreResult() - Result was stored.
[20:48:28] >> mysql_num_rows( Connection handle: 1 )
[20:48:28] CMySQLHandler::NumRows() - Returned 0 row(s)
[20:48:28] >> mysql_free_result( Connection handle: 1 )
[20:48:28] CMySQLHandler::FreeResult() - Result was successfully free'd.
[20:48:31] >> mysql_real_escape_string( Connection handle: 1 )
[20:48:31] CMySQLHandler::EscapeString(Larso99); - Escaped 7 characters to Larso99.
[20:48:31] >> mysql_real_escape_string( Connection handle: 1 )
[20:48:31] CMySQLHandler::EscapeString(tommy1); - Escaped 6 characters to tommy1.
[20:48:31] >> mysql_query( Connection handle: 1 )
[20:48:31] CMySQLHandler::Query(INSERT INTO `accounts` (`Name`, `Passwort`) VALUES ('Larso99', 'tommy1')) - An error has occured. (Error ID: 1054, Unknown column 'Passwort' in 'field list')
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(Level); - Escaped 5 characters to Level.
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:58:19] >> mysql_query( Connection handle: 1 )
[20:58:19] CMySQLHandler::Query(UPDATE `accounts` SET `Level` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Level' in 'field list')
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:58:19] >> mysql_query( Connection handle: 1 )
[20:58:19] CMySQLHandler::Query(UPDATE `accounts` SET `Adminlevel` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Adminlevel' in 'field list')
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:19] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:58:19] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:20] CMySQLHandler::EscapeString(Fraktion); - Escaped 8 characters to Fraktion.
[20:58:20] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:20] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:58:20] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:20] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:58:20] >> mysql_query( Connection handle: 1 )
[20:58:20] CMySQLHandler::Query(UPDATE `accounts` SET `Fraktion` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Fraktion' in 'field list')
[20:58:20] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:20] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
[20:58:20] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:20] CMySQLHandler::EscapeString(Team); - Escaped 4 characters to Team.
[20:58:20] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:20] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
[20:58:20] >> mysql_real_escape_string( Connection handle: 1 )
[20:58:20] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
[20:58:20] >> mysql_query( Connection handle: 1 )
[20:58:20] CMySQLHandler::Query(UPDATE `accounts` SET `Team` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Team' in 'field list')
Alles anzeigen
Der Fehler sollte nun klar sein, oder?
(UPDATE `accounts` SET `Team` = '0' WHERE `Name` = '')
[20:58:20] CMySQLHandler::Query(UPDATE `accounts` SET `Team` = '0' WHERE `Name` = '') - An error has occured. (Error ID: 1054, Unknown column 'Team' in 'field list')
Du hast kein Name und die Felder gibt es in der Tabelle nicht