17.08.2010, 15:15
Here is the Code:
public CreatePlayerAccount(playerid, password[])
{
new sql_abfrage[212];
format(sql_abfrage, sizeof(sql_abfrage), "INSERT INTO `spieler` (id, name, password, money) VALUES (NULL, '%s', MD5(\"%s\"), '%d');", Name(playerid), password, GetMoneyFromPlayer(playerid));
mysql_real_escape_string(sql_abfrage, sql_abfrage, Id(playerid));
mysql_query(sql_abfrage, -1, Id(playerid));
return 1;
}
Result: e.g.
In phpmyadmin it works, but here not.
public CreatePlayerAccount(playerid, password[])
{
new sql_abfrage[212];
format(sql_abfrage, sizeof(sql_abfrage), "INSERT INTO `spieler` (id, name, password, money) VALUES (NULL, '%s', MD5(\"%s\"), '%d');", Name(playerid), password, GetMoneyFromPlayer(playerid));
mysql_real_escape_string(sql_abfrage, sql_abfrage, Id(playerid));
mysql_query(sql_abfrage, -1, Id(playerid));
return 1;
}
Result: e.g.
Quote:
INSERT INTO `spieler` (id, name, password, money) VALUES (NULL, 'Seibay', MD5("Test"), '1500'); |