![]() |
|
[MySQL] Problema con registro de datos - Printable Version +- open.mp forum (https://forum.open.mp) +-- Forum: Other languages (https://forum.open.mp/forumdisplay.php?fid=23) +--- Forum: Spanish/Español (https://forum.open.mp/forumdisplay.php?fid=24) +---- Forum: Programación (https://forum.open.mp/forumdisplay.php?fid=51) +---- Thread: [MySQL] Problema con registro de datos (/showthread.php?tid=2307) |
[MySQL] Problema con registro de datos - GARS - 2022-07-19 Hola, tengo un problema con MySQL al registrar nuevos datos, mi servidor era SQLite y lo pase a MySQL pero al registrar un nuevo dato (registrar cuenta) en la base de datos esta no me figura/registra la el ID de forma ascendiente, me explico, en la tabla solo me registra como ID 0, as?: ![]() Y cuando quiero volver a registrar otros datos(cuenta) no registra. Ac? como est? la DB: Code: CREATE TABLE `cuenta` (
? `ID` int(11) NOT NULL,
? `IP` varchar(16) DEFAULT NULL,
? `NAME` varchar(24) DEFAULT NULL,
? `EMAIL` varchar(32) DEFAULT NULL,
? `PASS` varchar(65) DEFAULT NULL,
? `CONNECTED` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `cuenta`
? ADD PRIMARY KEY (`ID`);Y en la gamemode as? Code: RegisterNP(playerid)
{
new DB_Query[500];
format(DB_Query, sizeof DB_Query,
"\
INSERT INTO `CUENTA`\
(\
`IP`, `NAME`, `EMAIL`, `PASS`, `CONNECTED`\
)\
VALUES\
(\
'%q', '%q', '%q', '%q', '1'\
);\
", INFO_AC[playerid][iac_IP], INFO_AC[playerid][iac_NAME], INFO_AC[playerid][iac_EMAIL], INFO_AC[playerid][iac_PASS]);
mysql_tquery(DATABASE, DB_Query, "LoadRegisterNP", "i", playerid);
return 1;
}RE: [MySQL] Problema con registro de datos - drauxen - 2022-09-20 Pasaron 2 meses pero bueno, es por que al campo "ID" no le asignas el atributo?AUTO_INCREMENT, te quedar?a as?: Code: `ID` int(11) NOT NULL?AUTO_INCREMENT,RE: [MySQL] Problema con registro de datos - B0N3R - 2023-08-26 Por pura casualidad activaste el auto incremento en tu gestor de base de datos? |