18.10.2018, 20:28
Hello friends, I am learning MYSQL, I have an idea of pawno, but I am interested in learning about mysql and I have a gm where I can register normally, but then when I want to register another account, when I pass the part of placing a password it the dialog box comes out and the screen remains without loading anything else, when I look at the logs this appears.
MYSQL - ERRORID: 1062
Error: Duplicate entry '0' for key 'PRIMARY'
Query: INSERT INTO `Usuarios` (`Nombre`, `Clave`, `email`) VALUES ('Trevor_Winebackss', 126419382, 'nomail')
Callback: OnQueryFinish
Codes:
I do not know if something needs to be configured here:
I can not find what to do because I've just started learning from MYSQL, I'm waiting for an answer.
Thank you.
MYSQL - ERRORID: 1062
Error: Duplicate entry '0' for key 'PRIMARY'
Query: INSERT INTO `Usuarios` (`Nombre`, `Clave`, `email`) VALUES ('Trevor_Winebackss', 126419382, 'nomail')
Callback: OnQueryFinish
Codes:
PHP Code:
stock CrearCuenta(playerid, const name[], const encrypted, email[])
{
new
querystr [211];
InfoJugador[playerid][jClave] = encrypted;
opmysql_format(querystr, sizeof (querystr), "INSERT INTO `Usuarios` (`Nombre`, `Clave`, `email`) VALUES ('%e', %d, '%e')", name, encrypted, email);
opmysql_tquery( querystr, "OnQueryFinish", "ii", playerid, query_type_createaccount);
//Dialog (playerid, dRegistro, DIALOG_STYLE_MSGBOX, ""#CINFO"ЎCuenta registrada!", ""#CBLANCO"\n\nSu cuenta fue creada exitosamente, Ўahora puede comenzar a jugar!\n\n", "Jugar", "");
SetPVarInt (playerid, "pRegistro", 5);
printf("Consulta ejecutada | CUENTA: %s | QUERY : %s", querystr);
return 1;
}
PHP Code:
static
const table_Usuarios[] = "CREATE TABLE IF NOT EXISTS `Usuarios` (`userID` INT(8) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`userID`) );";
static
const table_Usuarios_data[][] =
{
"`Nombre` VARCHAR(24) NOT NULL",
"`Clave` INT(11) NOT NULL",
"`email` VARCHAR(38) NOT NULL",
"`ip` VARCHAR(16) NOT NULL",
"`UltimaConexion` VARCHAR(25) NOT NULL",
"`Registrado` BOOLEAN NOT NULL",
"`Sexo` TINYINT(2) NOT NULL",
"`Edad` SMALLINT(5) NOT NULL",
"`Pelea` SMALLINT(5) NOT NULL",
"`Estilo` SMALLINT(5) NOT NULL",
"`DNI` INT(11) NOT NULL",
"`Vida` FLOAT(11) NOT NULL",
"`Chaleco` FLOAT(11) NOT NULL",
"`Ropa_0` SMALLINT(5) NOT NULL",
"`Ropa_1` SMALLINT(5) NOT NULL",
"`Ropa_2` SMALLINT(5) NOT NULL",
"`Ropa_3` SMALLINT(5) NOT NULL",
"`CurrentSkin` SMALLINT(4) NOT NULL",
"`Dinero` INT(11) NOT NULL",
"`Banco` INT(11) NOT NULL",
"`Experiencia` FLOAT(11) NOT NULL",
"`Hambre` FLOAT(11) NOT NULL",
"`Cansancio` FLOAT(11) NOT NULL",
"`Orina` FLOAT(11) NOT NULL",
"`PosX` FLOAT(11) NOT NULL",
"`PosY` FLOAT(11) NOT NULL",
"`PosZ` FLOAT(11) NOT NULL",
"`Interior` INT(7) NOT NULL",
"`VirtualWorld` INT(11) NOT NULL",
"`inv_0` MEDIUMINT(5) NOT NULL",
"`invd_0` INT(12) NOT NULL",
"`inv_1` MEDIUMINT(5) NOT NULL",
"`invd_1` INT(12) NOT NULL",
"`inv_2` MEDIUMINT(5) NOT NULL",
"`invd_2` INT(12) NOT NULL",
"`inv_3` MEDIUMINT(5) NOT NULL",
"`invd_3` INT(12) NOT NULL",
"`inv_4` MEDIUMINT(5) NOT NULL",
"`invd_4` INT(12) NOT NULL",
"`inv_5` MEDIUMINT(5) NOT NULL",
"`invd_5` INT(12) NOT NULL",
"`inv_6` MEDIUMINT(5) NOT NULL",
"`invd_6` INT(12) NOT NULL",
"`inv_7` MEDIUMINT(5) NOT NULL",
"`invd_7` INT(12) NOT NULL",
"`inv_8` MEDIUMINT(5) NOT NULL",
"`invd_8` INT(12) NOT NULL",
"`inv_9` MEDIUMINT(5) NOT NULL",
"`invd_9` INT(12) NOT NULL",
"`Admin` INT(11) NOT NULL",
"`Lider` TINYINT(3) NOT NULL",
"`Miembro` TINYINT(3) NOT NULL",
"`FacDuty` TINYINT(3) NOT NULL",
"`Rango` TINYINT(3) NOT NULL",
"`Encarcelado` TINYINT(3) NOT NULL",
"`TiempoCarcel` INT(11) NOT NULL",
"`Minutos` INT(11) NOT NULL",
"`Horas` INT(11) NOT NULL",
"`Nivel` INT(11) NOT NULL",
"`LiderFam` TINYINT(3) NOT NULL",
"`MiembroFam` TINYINT(3) NOT NULL",
"`RangoFam` TINYINT(3) NOT NULL",
"`Trabajo` TINYINT(3) NOT NULL",
"`NivelTrabajo` SMALLINT(5) NOT NULL",
"`Entregas` MEDIUMINT(6) NOT NULL",
"`Necesidades` TINYINT(3) NOT NULL",
"`IDCuentaB` INT(5) NOT NULL",
"`CurrentObj` MEDIUMINT(5) NOT NULL",
"`CurrentObjD` INT(11) NOT NULL",
"`ObjetoColgado` MEDIUMINT(5) NOT NULL",
"`ObjetoColgadoData` INT(11) NOT NULL",
"`ChalecoObj` MEDIUMINT(5) NOT NULL",
"`ChalecoData` INT(11) NOT NULL",
"`BuscadorVeh` BOOLEAN NOT NULL",
"`AdminJail` VARCHAR(24) NOT NULL",
"`LicenciaAuto` BOOLEAN NOT NULL",
"`LicenciaMoto` BOOLEAN NOT NULL",
"`LicenciaArmas` BOOLEAN NOT NULL",
"`Cosechas` MEDIUMINT(6) NOT NULL",
"`AttachModel_0` INT(11) NOT NULL",
"`AttachModel_1` INT(11) NOT NULL",
"`AttachModel_2` INT(11) NOT NULL",
"`AttachModel_3` INT(11) NOT NULL",
"`AttachModel_4` INT(11) NOT NULL",
"`AttachBone_0` SMALLINT(3) NOT NULL",
"`AttachBone_1` SMALLINT(3) NOT NULL",
"`AttachBone_2` SMALLINT(3) NOT NULL",
"`AttachBone_3` SMALLINT(3) NOT NULL",
"`AttachBone_4` SMALLINT(3) NOT NULL",
"`AttachOcultado_0` BOOLEAN NOT NULL",
"`AttachOcultado_1` BOOLEAN NOT NULL",
"`AttachOcultado_2` BOOLEAN NOT NULL",
"`AttachOcultado_3` BOOLEAN NOT NULL",
"`AttachOcultado_4` BOOLEAN NOT NULL",
"`Estrellas` MEDIUMINT(7) NOT NULL",
"`Bomba` BOOLEAN NOT NULL",
"`Repartidas` MEDIUMINT(6) NOT NULL",
"`Barridas` MEDIUMINT(6) NOT NULL",
"`Acento` TINYINT(3) NOT NULL",
"`Muerto` BOOLEAN NOT NULL",
"`BlockDudas` BOOLEAN NOT NULL",
"`BlockFam` BOOLEAN NOT NULL",
"`BlockFac` BOOLEAN NOT NULL",
"`Esposado` BOOLEAN NOT NULL",
"`TiempoDudas` INT(11) NOT NULL",
"`Ibu400` INT(7) NOT NULL",
"`Ibu600` INT(7) NOT NULL",
"`Falopeado` INT(6) NOT NULL",
"`Papeado` INT(6) NOT NULL",
"`Adv` TINYINT(3) NOT NULL",
"`AdmAdv` TINYINT(3) NOT NULL",
"`AttachPosx_0` FLOAT(11) NOT NULL",
"`AttachPosx_1` FLOAT(11) NOT NULL",
"`AttachPosx_2` FLOAT(11) NOT NULL",
"`AttachPosx_3` FLOAT(11) NOT NULL",
"`AttachPosx_4` FLOAT(11) NOT NULL",
"`AttachPosy_0` FLOAT(11) NOT NULL",
"`AttachPosy_1` FLOAT(11) NOT NULL",
"`AttachPosy_2` FLOAT(11) NOT NULL",
"`AttachPosy_3` FLOAT(11) NOT NULL",
"`AttachPosy_4` FLOAT(11) NOT NULL",
"`AttachPosz_0` FLOAT(11) NOT NULL",
"`AttachPosz_1` FLOAT(11) NOT NULL",
"`AttachPosz_2` FLOAT(11) NOT NULL",
"`AttachPosz_3` FLOAT(11) NOT NULL",
"`AttachPosz_4` FLOAT(11) NOT NULL",
"`AttachAngx_0` FLOAT(11) NOT NULL",
"`AttachAngx_1` FLOAT(11) NOT NULL",
"`AttachAngx_2` FLOAT(11) NOT NULL",
"`AttachAngx_3` FLOAT(11) NOT NULL",
"`AttachAngx_4` FLOAT(11) NOT NULL",
"`AttachAngy_0` FLOAT(11) NOT NULL",
"`AttachAngy_1` FLOAT(11) NOT NULL",
"`AttachAngy_2` FLOAT(11) NOT NULL",
"`AttachAngy_3` FLOAT(11) NOT NULL",
"`AttachAngy_4` FLOAT(11) NOT NULL",
"`AttachAngz_0` FLOAT(11) NOT NULL",
"`AttachAngz_1` FLOAT(11) NOT NULL",
"`AttachAngz_2` FLOAT(11) NOT NULL",
"`AttachAngz_3` FLOAT(11) NOT NULL",
"`AttachAngz_4` FLOAT(11) NOT NULL",
"`AttachEscx_0` FLOAT(11) NOT NULL",
"`AttachEscx_1` FLOAT(11) NOT NULL",
"`AttachEscx_2` FLOAT(11) NOT NULL",
"`AttachEscx_3` FLOAT(11) NOT NULL",
"`AttachEscx_4` FLOAT(11) NOT NULL",
"`AttachEscy_0` FLOAT(11) NOT NULL",
"`AttachEscy_1` FLOAT(11) NOT NULL",
"`AttachEscy_2` FLOAT(11) NOT NULL",
"`AttachEscy_3` FLOAT(11) NOT NULL",
"`AttachEscy_4` FLOAT(11) NOT NULL",
"`AttachEscz_0` FLOAT(11) NOT NULL",
"`AttachEscz_1` FLOAT(11) NOT NULL",
"`AttachEscz_2` FLOAT(11) NOT NULL",
"`AttachEscz_3` FLOAT(11) NOT NULL",
"`AttachEscz_4` FLOAT(11) NOT NULL"
};
Thank you.