MYSQL Saving wrongly.
#1

Код:
		case 3:
	    {
	 		if(!response)
		    {
		        SendClientMessage(playerid, -1, "Plz relog to make new.");
	            Kick(playerid);
			}
	        else
	        {
				format(Query, sizeof(Query), "UPDATE `accounts` SET `Day` = '%d' WHERE `Name` = '%s'", inputtext, GetName(playerid));
				mysql_query(Query);
				}
		}
It's my ondialogresponse, but it saves always with number 55, but I wront 7 into database, Why it keeps doing it ?
It's like PlayerInfo[playerid][pDay]
Reply
#2

I think you have to make it separately
Reply
#3

Explane me
Reply
#4

Well inputtext is a string and you're trying to insert it as an integer, you need to convert it to an integer before doing so, for example:

pawn Код:
format(Query, sizeof(Query), "UPDATE `accounts` SET `Day` = '%d' WHERE `Name` = '%s'", strval(inputtext), GetName(playerid));
Reply
#5

Or use %s instead

Btw, learn identing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)