MYSQL INSERT INTO
#1

Hello guys,

Mysql not registered my account. What is problem ?

Код:
[MYSQL ERROR]: ID: 1364
[17:11:43] [MYSQL ERROR]: Error: Field 'Status' doesn't have a default value
[17:11:43] [MYSQL ERROR]: Query: INSERT INTO `Accounts` (`Username`, `Password`, `RegisterIP`, `RegisterDate`) VALUES('Arnold','36C35836961161C26F85E363239D733AB5CF23D47544179E4B26E8AC3F69FC5596BBA2283C3BEBD6A8115CC59628126DE6ECEA4C50235AB2F406C1C031369FFC','127.0.0.1', 1498572703)
MAYBE PROBLEM THİS CODE

Код:
Dialog:REGISTER(playerid, response, listitem, inputtext[])
{
	if(strlen(inputtext) < 6 || strlen(inputtext) > 24)
    {
        SendClientMessage(playerid, COLOR_ORANGERED, "You must insert a password between 6-24 characters!");
        Register_Dialog(playerid);
    }
    else if(strlen(inputtext) > 5 && strlen(inputtext) < 24)
    {
        new query[400],escapepass[129];
        
        WP_Hash(escapepass, sizeof(escapepass), inputtext);

		GetPlayerIp(playerid, Character[playerid][RegisterIP], 16);

    	mysql_format(SQL_CONNECTION, query, sizeof(query), "INSERT INTO Accounts (Username, Password, RegisterIP, RegisterDate) VALUES('%e','%e','%e', %d)", GetName(playerid), escapepass, Character[playerid][RegisterIP], gettime());
		mysql_tquery(SQL_CONNECTION, query, "GetAccID", "i", playerid);
		
        Quiz(playerid, 1);
	}
    return 1;
}
Reply
#2

Whats your MYSQL Plugin Version ? Show us the code
Reply
#3

Mysql plugin version r39 and how to find in phpmyadmin this code ?
Reply
#4

its not procedded, show us the code
Reply
#5

Maybe this code ?

Quote:

mysql_format(SQL_CONNECTION, query, sizeof(query), "INSERT INTO Accounts (Username, Password, RegisterIP, RegisterDate) VALUES('%e','%e','%e', %d)", GetName(playerid), escapepass, Character[playerid][RegisterIP], gettime());
mysql_tquery(SQL_CONNECTION, query, "GetAccID", "i", playerid);

Reply
#6

Help please guys :/
Reply
#7

Where is the ACTUAL error log with the ACTUAL error code and error message?
Reply
#8

This error;

Quote:

[MYSQL ERROR]: ID: 1364
[17:11:43] [MYSQL ERROR]: Error: Field 'Status' doesn't have a default value
[17:11:43] [MYSQL ERROR]: Query: INSERT INTO `Accounts` (`Username`, `Password`, `RegisterIP`, `RegisterDate`) VALUES('Arnold','36C35836961161C26F85E363239D733AB 5CF23D47544179E4B26E8AC3F69FC5596BBA2283C3BEBD6A81 15CC59628126DE6ECEA4C50235AB2F406C1C031369FFC','12 7.0.0.1', 1498572703)

Maybe this code;

Quote:

Dialog:REGISTER(playerid, response, listitem, inputtext[])
{
if(strlen(inputtext) < 6 || strlen(inputtext) > 24)
{
SendClientMessage(playerid, COLOR_ORANGERED, "You must insert a password between 6-24 characters!");
Register_Dialog(playerid);
}
else if(strlen(inputtext) > 5 && strlen(inputtext) < 24)
{
new query[400],escapepass[129];

WP_Hash(escapepass, sizeof(escapepass), inputtext);

GetPlayerIp(playerid, Character[playerid][RegisterIP], 16);

mysql_format(SQL_CONNECTION, query, sizeof(query), "INSERT INTO Accounts (Username, Password, RegisterIP, RegisterDate) VALUES('%e','%e','%e', %d)", GetName(playerid), escapepass, Character[playerid][RegisterIP], gettime());
mysql_tquery(SQL_CONNECTION, query, "GetAccID", "i", playerid);

Quiz(playerid, 1);
}
return 1;
}

sorry my english bad..
Reply
#9

The error is literally right infront of your eyes. It's even prefixed with the word "Error:", funnily enough.
Quote:

[17:11:43] [MYSQL ERROR]: Error: Field 'Status' doesn't have a default value

You don't have a default value set for the Status field and also don't provide a value inline in the insert statement. Go to phpMyAdmin (or whatever you're using) and add a default value to it. ****** will help you here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)