19.05.2010, 08:08
pawn Код:
public OnPlayerConnect(playerid)
{
format(query, sizeof(query), "SELECT `userid` FROM `users` WHERE `username` = '%s'", GetName(playerid));
samp_mysql_query(query);
samp_mysql_store_result();
if(samp_mysql_num_rows() == 0)
{
format(query, sizeof(query), "INSERT INTO `users` (userid, username, money) VALUES(0, \"%s\", 0)", GetName(playerid));
samp_mysql_query(query);
}
else
{
format(query, sizeof(query), "SELECT * FROM `users` WHERE `username` = '%s'", GetName(playerid));
samp_mysql_query(query);
samp_mysql_store_result();
samp_mysql_fetch_row(result);
}
return 1;
}
Its not creating it, Why is that? Im a real real real REAL beginner at MySQL on SAMP so if im doing it completely wrong then..