25.03.2015, 02:43
I am back in using mySQL once again, the last time i used it is way way back in 2012 with the Secret Formula Thing Server Project which fails.
So anyway let's get to the point, I have been following [HiC]TheKiller's MySQL tutorial, i have corrected some errors from his tutorial though, However i am getting this strange warning.
Note, the password cactus isn't the original password of mine i changed it due to the privacy.
Code:
How do i also insert userid (automatically) ?
I AM USING MYSQL R5
So anyway let's get to the point, I have been following [HiC]TheKiller's MySQL tutorial, i have corrected some errors from his tutorial though, However i am getting this strange warning.
Код:
CMySQLHandler::Query(INSERT INTO `users` (`username`, `password`, `ip`, `registerdate`, `helmet`, `admin`, `vip`, `scores`, `money`, `kills`, `deaths`, `rank`) VALUES('[S]JaKe', SHA1('cactus'), '192.168.1.100', '03/25/2015', 0, 0, 0, 30000, 0, 0, 0)) - An error has occured. (Error ID: 1136, Column count doesn't match value count at row 1)
Code:
PHP код:
stock RegisterPlayer(playerid, passwordstring[])
{
new query[600];
new yearEx, monthEx, dayEx;
getdate(yearEx, monthEx, dayEx);
format(pInfo[playerid][RegisterDate], 90, "%02d/%02d/%d", monthEx, dayEx, yearEx);
format(query, sizeof(query), "INSERT INTO `users` (`username`, `password`, `ip`, `registerdate`, `helmet`, `admin`, `vip`, `scores`, `money`, `kills`, `deaths`, `rank`) VALUES('%s', SHA1('%s'), '%s', '%s', 0, 0, 0, 30000, 0, 0, 0)", nameEx(playerid), passwordstring, pInfo[playerid][IP], pInfo[playerid][RegisterDate]);
mysql_query(query);
print(query);
GivePlayerMoney(playerid, pInfo[playerid][Money]);
SendClientMessage(playerid, -1, "Info: "col_y"You have been registered on this server!");
LoggedIn[playerid] = 1;
return 1;
}
I AM USING MYSQL R5