Перейти к содержанию
Авторизация  
Zishka

MYSQL ошибка

Рекомендуемые сообщения

Zishka

После запуска мода sql ошибка:

[15:13:55] [WARNING] CMySQLResult::GetRowData - invalid row ('0') or field index ('25')
[15:13:56] [WARNING] CMySQLResult::GetRowData - invalid row ('8') or field index ('1')
[15:13:56] [ERROR] cache_get_row_int - invalid datatype
[15:13:56] [WARNING] CMySQLResult::GetRowData - invalid row ('8') or field index ('2')
[15:13:56] [ERROR] cache_get_row_int - invalid datatype
[15:13:56] [WARNING] CMySQLResult::GetRowData - invalid row ('8') or field index ('3')
[15:13:56] [ERROR] cache_get_row_int - invalid datatype
	p_info[playerid][pID] = cache_get_row_int(0, 0, dbHandle); // id
	cache_get_row(0, 3, p_info[playerid][pLastIP], dbHandle, 16); // ip
	p_info[playerid][pAdmin] = cache_get_row_int(0, 6, dbHandle); // admin
	p_info[playerid][pSecurityCode] = cache_get_row_int(0, 7, dbHandle); // securitycode
	p_info[playerid][pCheckCode] = cache_get_row_int(0, 8, dbHandle); // checkcode
	cache_get_row(0, 9, p_info[playerid][pMail], dbHandle, 64); // mail
	p_info[playerid][pLevel] = cache_get_row_int(0, 10, dbHandle); // level
	p_info[playerid][pCash] = cache_get_row_int(0, 11, dbHandle); // cash
	p_info[playerid][pBank] = cache_get_row_int(0, 12, dbHandle); // bank
	p_info[playerid][pExp] = cache_get_row_int(0, 13, dbHandle); // exp
	cache_get_row(0, 14, p_info[playerid][pRegIP], dbHandle, 16); // regip
	cache_get_row(0, 15, p_info[playerid][pRegData], dbHandle, 15); // datareg
	p_info[playerid][pLeader] = cache_get_row_int(0, 16, dbHandle); // leader
	p_info[playerid][pTempLeader] = cache_get_row_int(0, 17, dbHandle); // templeader
	p_info[playerid][pMember] = cache_get_row_int(0, 18, dbHandle); // member
	p_info[playerid][pRank] = cache_get_row_int(0, 19, dbHandle); // rank
	p_info[playerid][pWarn] = cache_get_row_int(0, 20, dbHandle); // warn
	p_info[playerid][pSex] = cache_get_row_int(0, 21, dbHandle); // sex
	p_info[playerid][pAge] = cache_get_row_int(0, 22, dbHandle); // age
	ClosetSkins[playerid][0] = cache_get_row_int(0, 23, dbHandle); // model
	p_info[playerid][pMemberSkin] = cache_get_row_int(0, 24, dbHandle); // memberskin
	cache_get_row(0, 25, p_info[playerid][pLics], dbHandle, 16); // lic
	p_info[playerid][pMuted] = cache_get_row_int(0, 28, dbHandle); // mute
	p_info[playerid][pLeaderPosition] = cache_get_row_int(0, 29, dbHandle); // news
	p_info[playerid][pRobbery] = cache_get_row_int(0, 30, dbHandle); //checktime
	cache_get_row(0, 32, p_info[playerid][pPhones], dbHandle, 16); // phone
	p_info[playerid][pPhoneNumber] = cache_get_row_int(0, 33, dbHandle); // phonenumber
	cache_get_row(0, 34, p_info[playerid][pTexts], dbHandle, 40); // text
	p_info[playerid][pJail] = cache_get_row_int(0, 35, dbHandle); // jail
	p_info[playerid][pJailTime] = cache_get_row_int(0, 36, dbHandle); // jailtime
	p_info[playerid][pWanted] = cache_get_row_int(0, 37, dbHandle); // wanted
	p_info[playerid][pWantedTime] = cache_get_row_int(0, 38, dbHandle); // wantedtime
	cache_get_row(0, 39, p_info[playerid][pWantedWho], dbHandle, MAX_PLAYER_NAME); // wantedwho
	cache_get_row(0, 40, p_info[playerid][pWantedReason], dbHandle, 32); // wantedreason
	PlayerHP[playerid] = cache_get_row_float(0, 41, dbHandle); // heal
	p_info[playerid][pDrugs] = cache_get_row_int(0, 42, dbHandle); // drugs
	p_info[playerid][pPatron] = cache_get_row_int(0, 43, dbHandle); // patron
	p_info[playerid][pGunAmount] = cache_get_row_int(0, 44, dbHandle); // gunamount
	p_info[playerid][pCrimes] = cache_get_row_int(0, 45, dbHandle); // crimes
	p_info[playerid][pJob] = cache_get_row_int(0, 46, dbHandle); // job
	p_info[playerid][pMarried] = cache_get_row_int(0, 47, dbHandle); // married
	cache_get_row(0, 48, p_info[playerid][pWhoMarried], dbHandle, MAX_PLAYER_NAME); // whomarried
	cache_get_row(0, 49, p_info[playerid][pReferal], dbHandle, MAX_PLAYER_NAME); // referal
	p_info[playerid][pRefMoney] = cache_get_row_int(0, 50, dbHandle); // refmoney
Спойлер

--
-- Структура таблицы `accounts`
--

CREATE TABLE IF NOT EXISTS `accounts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(24) NOT NULL,
  `password` varchar(32) NOT NULL,
  `ip` varchar(16) NOT NULL DEFAULT '0.0.0.0',
  `veh_number` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `veh_reg` int(1) NOT NULL DEFAULT '0',
  `admin` int(11) NOT NULL DEFAULT '0',
  `securitycode` int(11) NOT NULL DEFAULT '0',
  `checkcode` int(11) NOT NULL DEFAULT '0',
  `mail` varchar(64) NOT NULL DEFAULT 'None',
  `level` int(11) NOT NULL DEFAULT '1',
  `cash` int(24) NOT NULL DEFAULT '1000',
  `bank` int(11) NOT NULL DEFAULT '250',
  `exp` int(11) NOT NULL DEFAULT '0',
  `regip` varchar(16) NOT NULL DEFAULT '0.0.0.0',
  `datareg` varchar(15) NOT NULL DEFAULT '0.0.0',
  `leader` int(3) NOT NULL DEFAULT '0',
  `templeader` int(3) NOT NULL DEFAULT '0',
  `member` int(3) NOT NULL DEFAULT '0',
  `rank` int(3) NOT NULL DEFAULT '0',
  `warn` int(11) NOT NULL DEFAULT '0',
  `sex` int(11) NOT NULL DEFAULT '0',
  `age` int(11) NOT NULL DEFAULT '0',
  `Skin` int(11) NOT NULL DEFAULT '0',
  `memberskin` int(11) NOT NULL DEFAULT '0',
  `lic` varchar(16) NOT NULL DEFAULT '1, 1, 1, 1, 1',
  `guns` varchar(56) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0',
  `ammos` varchar(56) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0',
  `mute` int(11) NOT NULL DEFAULT '0',
  `leaderposition` int(11) NOT NULL DEFAULT '0',
  `robbery` int(11) NOT NULL DEFAULT '0',
  `news` int(11) NOT NULL DEFAULT '0',
  `phone` varchar(16) NOT NULL DEFAULT '0, 0',
  `phonenumber` int(11) NOT NULL DEFAULT '0',
  `text` varchar(20) NOT NULL DEFAULT '0, 0, 0, 0, 0, 0',
  `jail` int(11) NOT NULL DEFAULT '0',
  `jailtime` int(11) NOT NULL DEFAULT '0',
  `wanted` int(11) NOT NULL DEFAULT '0',
  `wantedtime` int(11) NOT NULL DEFAULT '0',
  `wantedwho` varchar(24) NOT NULL DEFAULT 'None',
  `wantedreason` varchar(32) NOT NULL DEFAULT 'None',
  `heal` varchar(11) NOT NULL DEFAULT '100.0',
  `drugs` int(11) NOT NULL DEFAULT '0',
  `patron` int(11) NOT NULL DEFAULT '0',
  `gunamount` int(11) NOT NULL DEFAULT '0',
  `crimes` int(11) NOT NULL DEFAULT '0',
  `job` int(11) NOT NULL DEFAULT '0',
  `married` int(11) NOT NULL DEFAULT '0',
  `whomarried` varchar(24) NOT NULL DEFAULT 'None',
  `referal` varchar(24) NOT NULL DEFAULT 'None',
  `refmoney` int(11) NOT NULL DEFAULT '0',
  `paycheck` int(11) NOT NULL DEFAULT '0',
  `charity` int(11) NOT NULL DEFAULT '0',
  `vip` int(11) NOT NULL DEFAULT '0',
  `viptime` int(11) NOT NULL DEFAULT '0',
  `time` int(11) NOT NULL DEFAULT '0',
  `jackcar` int(11) NOT NULL DEFAULT '0',
  `credits` int(11) NOT NULL DEFAULT '0',
  `totalcredits` int(11) NOT NULL DEFAULT '0',
  `skin1` int(11) NOT NULL DEFAULT '0',
  `skin2s` int(11) NOT NULL DEFAULT '0',
  `skin3s` int(11) NOT NULL DEFAULT '0',
  `spawnchange` int(11) NOT NULL DEFAULT '0',
  `sdpistol` int(11) NOT NULL DEFAULT '0',
  `deserteagle` int(11) NOT NULL DEFAULT '0',
  `shotgun` int(11) NOT NULL DEFAULT '0',
  `mp5` int(11) NOT NULL DEFAULT '0',
  `ak47` int(11) NOT NULL DEFAULT '0',
  `m4` int(11) NOT NULL DEFAULT '0',
  `pistol` int(11) NOT NULL DEFAULT '0',
  `microuzi` int(11) NOT NULL DEFAULT '0',
  `hunger` int(11) NOT NULL DEFAULT '100',
  `arrestspawn` int(11) NOT NULL DEFAULT '0',
  `pRAZ` int(11) NOT NULL DEFAULT '0',
  `online` int(11) NOT NULL DEFAULT '0',
  `zakon` int(11) NOT NULL DEFAULT '0',
  `city` int(11) NOT NULL DEFAULT '0',
  `repcar` varchar(16) NOT NULL DEFAULT '0, 0',
  `warntime` int(11) NOT NULL DEFAULT '0',
  `watch` int(11) NOT NULL DEFAULT '0',
  `ciggare` int(11) NOT NULL DEFAULT '0',
  `sprunk` int(11) NOT NULL DEFAULT '7000',
  `mask` int(11) NOT NULL DEFAULT '0',
  `phonebalance` int(11) NOT NULL DEFAULT '100',
  `truckskill` int(11) NOT NULL DEFAULT '0',
  `Disease0` int(11) NOT NULL DEFAULT '0',
  `Disease1` int(11) NOT NULL DEFAULT '0',
  `Disease2` int(11) NOT NULL DEFAULT '0',
  `renthouse` int(11) NOT NULL DEFAULT '-1',
  `Skin2` int(11) NOT NULL DEFAULT '0',
  `Skin3` int(11) NOT NULL DEFAULT '0',
  `Skin4` int(11) NOT NULL DEFAULT '0',
  `Skin5` int(11) NOT NULL DEFAULT '0',
  `timehour` int(11) NOT NULL DEFAULT '0',
  `aptechka` int(11) NOT NULL DEFAULT '0',
  `Voennik` int(11) NOT NULL DEFAULT '0',
  `music` int(11) NOT NULL DEFAULT '0',
  `improves` varchar(32) NOT NULL DEFAULT '0, 0, 0, 0',
  `datavhod` varchar(15) NOT NULL DEFAULT '0.0.0',
  `fraction_date` varchar(16) NOT NULL DEFAULT '0.0.0',
  `family_date` varchar(16) NOT NULL DEFAULT '0.0.0',
  `passport` int(11) NOT NULL DEFAULT '0',
  `phnumber3` int(11) NOT NULL DEFAULT '0',
  `phnumber4` int(11) NOT NULL DEFAULT '0',
  `phnumber5` int(11) NOT NULL DEFAULT '0',
  `phnumber6` int(11) NOT NULL DEFAULT '0',
  `phnumber7` int(11) NOT NULL DEFAULT '0',
  `phnumber8` int(11) NOT NULL DEFAULT '0',
  `vehiclekey` int(11) NOT NULL DEFAULT '0',
  `mailconf` int(11) NOT NULL DEFAULT '0',
  `fishki` int(11) NOT NULL DEFAULT '0',
  `vehiclekey1` int(11) NOT NULL,
  `data_NONLINE` int(11) NOT NULL DEFAULT '0',
  `data_NONLINE_1` int(11) NOT NULL DEFAULT '0',
  `data_NONLINE_2` int(11) NOT NULL DEFAULT '0',
  `data_NONLINE_3` int(11) NOT NULL DEFAULT '0',
  `data_NONLINE_4` int(11) NOT NULL DEFAULT '0',
  `data_NONLINE_5` int(11) NOT NULL DEFAULT '0',
  `data_NONLINE_6` int(11) NOT NULL DEFAULT '0',
  `cA1` float NOT NULL,
  `cModel1` int(11) NOT NULL,
  `cClass1` int(11) NOT NULL,
  `cFuel1` int(11) NOT NULL,
  `cColor_1` int(11) NOT NULL,
  `cColor_2` int(11) NOT NULL,
  `cLock1` int(11) NOT NULL,
  `cCost1` int(11) NOT NULL,
  `cVehcom1` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `cPaintjob1` int(11) NOT NULL,
  `veh_number1` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `cVirtual1` int(11) NOT NULL,
  `cVirtual2` int(11) NOT NULL,
  `family` int(11) NOT NULL,
  `familysozd` int(11) NOT NULL,
  `familyzam` int(11) NOT NULL,
  `black0` int(1) NOT NULL,
  `black1` int(1) NOT NULL,
  `black2` int(1) NOT NULL,
  `black3` int(1) NOT NULL,
  `black4` int(1) NOT NULL,
  `black5` int(1) NOT NULL,
  `black6` int(1) NOT NULL,
  `black7` int(1) NOT NULL,
  `black8` int(1) NOT NULL,
  `black9` int(1) NOT NULL,
  `black10` int(1) NOT NULL,
  `black11` int(11) NOT NULL,
  `black12` int(11) NOT NULL,
  `set1` int(1) NOT NULL,
  `set2` int(1) NOT NULL,
  `set3` int(1) NOT NULL,
  `set4` int(1) NOT NULL,
  `set5` int(1) NOT NULL,
  `set6` int(1) NOT NULL,
  `set7` int(1) NOT NULL,
  `sjob0` int(11) NOT NULL,
  `sjob1` int(11) NOT NULL,
  `sjob2` int(11) NOT NULL,
  `del_obj` int(11) NOT NULL,
  `lwarn` int(11) NOT NULL,
  `awarn` int(11) NOT NULL,
  `deactivate` int(11) NOT NULL DEFAULT '0',
  `ban_time` int(11) NOT NULL,
  `pDonateCar` int(11) NOT NULL DEFAULT '0',
  `pDonateH_0` int(11) NOT NULL DEFAULT '0',
  `pDonateH_1` int(11) NOT NULL DEFAULT '0',
  `pDonateH_2` int(11) NOT NULL DEFAULT '0',
  `binder` varchar(128) NOT NULL DEFAULT 'None',
  `binder1` varchar(128) NOT NULL DEFAULT 'None',
  `binder2` varchar(128) NOT NULL DEFAULT 'None',
  `binder3` varchar(128) NOT NULL DEFAULT 'None',
  `binder4` varchar(128) NOT NULL DEFAULT 'None',
  `pSetAnim` int(11) NOT NULL DEFAULT '0',
  `pSetWalk` int(11) NOT NULL DEFAULT '0',
  `cCost2` int(11) NOT NULL,
  `cVehcom2` int(11) NOT NULL,
  `cPaintjob2` int(11) NOT NULL,
  `veh_number2` int(11) NOT NULL,
  `credit` int(11) NOT NULL DEFAULT '0',
  `creditmoney` int(11) NOT NULL DEFAULT '0',
  `copter` int(11) NOT NULL DEFAULT '0',
  `copter_color1` int(11) NOT NULL DEFAULT '0',
  `copter_color2` int(11) NOT NULL DEFAULT '0',
  `presents` varchar(64) NOT NULL DEFAULT '0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0    ',
  `pModelPhone` int(11) NOT NULL,
  `SoundSMS` int(11) NOT NULL,
  `SoundCall` int(11) NOT NULL,
  `EPLAYER` varchar(128) CHARACTER SET cp1251 NOT NULL DEFAULT '0.0,0.0,0.0,0,0,0',
  `P_Style0` int(11) NOT NULL DEFAULT '0',
  `P_Style1` int(11) NOT NULL DEFAULT '0',
  `pStats1` int(11) DEFAULT '0',
  `pStats2` int(11) NOT NULL DEFAULT '0',
  `garage` int(11) NOT NULL DEFAULT '-1',
  `pass_s` int(11) NOT NULL DEFAULT '0',
  `pass_n` int(11) NOT NULL DEFAULT '0',
  `pass_d` varchar(32) NOT NULL DEFAULT '0.0.0',
  `acc_player_0` varchar(64) NOT NULL DEFAULT '-1,0.0,0.0,0.0',
  `acc_player_1` varchar(64) NOT NULL DEFAULT '-1,0.0,0.0,0.0',
  `acc_player_2` varchar(64) NOT NULL DEFAULT '-1,0.0,0.0,0.0',
  `acc_player_3` varchar(64) NOT NULL DEFAULT '-1,0.0,0.0,0.0',
  `acc_player_4` varchar(64) NOT NULL DEFAULT '-1,0.0,0.0,0.0',
  `lastvisit` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '-',
  `psih` int(11) NOT NULL DEFAULT '0',
  `aue` int(11) NOT NULL DEFAULT '0',
  `bumbox` int(11) NOT NULL DEFAULT '0',
  `gauth` int(1) NOT NULL DEFAULT '0',
  `gcode` varchar(17) NOT NULL,
  `keysig` int(1) NOT NULL DEFAULT '0',
  `logig` int(1) NOT NULL DEFAULT '0',
  `acceptick` int(1) NOT NULL DEFAULT '0',
  `KOLOKOL` int(1) NOT NULL DEFAULT '0',
  `DAMAG` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;

Заранее спасибо :3

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
16Shadows

У Вас проблема в неправильных индексах полей/строк и типах данных.

Лучше использовать функции с именами полей, чтобы не было путаницы с их id.

Для R41 (или с R40 изменилось, точно не помню):

cache_get_value_name(row, field[], dest[]);
cache_get_value_name_int(row, field[], dest);
cache_get_value_name_float(row, field[], Float:dest);

 Где field - не индекс поля, а его название.

Для более ранних

cache_get_field_content(row, field[], dest[])

С аналогичным набором аргументов

  • Like 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Zishka
7 часов назад, 16Shadows сказал:

У Вас проблема в неправильных индексах полей/строк и типах данных.

Лучше использовать функции с именами полей, чтобы не было путаницы с их id.

Для R41 (или с R40 изменилось, точно не помню):


cache_get_value_name(row, field[], dest[]);
cache_get_value_name_int(row, field[], dest);
cache_get_value_name_float(row, field[], Float:dest);

 Где field - не индекс поля, а его название.

Для более ранних


cache_get_field_content(row, field[], dest[])

С аналогичным набором аргументов

Ясно. Жалко что у меня 39 версия

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Web
12 минут назад, Zishka сказал:

Ясно. Жалко что у меня 39 версия

а в чем проблема обновиться до последней версии? От этого только польза будет. Так как устраняются баги прошлых версий. Да, это займет время. Но от этого будет польза.

Изменено пользователем Wеb
  • Like 1

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Zishka

Когда переводил встретился с такой ошибкой:

Спойлер

Gamenix.pwn(8175) : warning 213: tag mismatch: expected tag none ("_"), but found "MySQL"

Код:

	new rows = cache_get_row_count(dbHandle);//8175 строка
	if(!rows)
	{
  		STRING_GLOBAL = "";
		format(STRING_GLOBAL,512,"INSERT INTO "T_ONLINE_PLAYER" (accountid,date,online_sec,afk_sec) VALUES (%d, CURDATE(), %d, %d)", p_info[playerid][pID], gOnlinePlayer[playerid][0], gOnlinePlayerAFK[playerid][0]);
		mysql_tquery(dbHandle,STRING_GLOBAL);
	}
	else
	{
   		STRING_GLOBAL = "";
		format(STRING_GLOBAL,512,"UPDATE "T_ONLINE_PLAYER" SET online_sec = %d, afk_sec = %d WHERE accountid = %d AND date >= CURDATE()", gOnlinePlayer[playerid][0], gOnlinePlayerAFK[playerid][0], p_info[playerid][pID]);
		mysql_tquery(dbHandle,STRING_GLOBAL);
	}

 

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
16Shadows

В новой версии функции

native cache_get_row_count(&destination);

Нужно в качестве аргумента передавать переменную, куда нужно сохранить число строк.

  • Like 2

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×

Важная информация

Мы разместили cookie-файлы на ваше устройство, чтобы помочь сделать этот сайт лучше. Вы можете изменить свои настройки cookie-файлов, или продолжить без изменения настроек.