Raised This Month: $51 Target: $400
 12% 

[L4D2] DBResultSet.FetchInt Problem..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KoreanPeople
Junior Member
Join Date: Jun 2019
Old 06-30-2019 , 07:34   [L4D2] DBResultSet.FetchInt Problem..
Reply With Quote #1

i can playerLv[client] = DBResultSet.FetchInt(0) // but not correct data. It's not what I want.
but cant playerEXP[client] = DBResultSet.FetchInt(1); // Error

what a problem ?

my dedicated console

L 06/30/2019 - 20:24:52: [SM] Exception reported: Error fetching data from field 2
L 06/30/2019 - 20:24:52: [SM] Blaming: test.smx
L 06/30/2019 - 20:24:52: [SM] Call stack trace:
L 06/30/2019 - 20:24:52: [SM] [0] DBResultSet.FetchInt
L 06/30/2019 - 20:24:52: [SM] [1] Line 44, C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\ test.sp::playerloadData

field = not sql column ??

my db table column
name(varchar), steamid(varchar), lv(int), gold(int), exp(int)

FetchInt(0) = not lv ?

How do I get the correct data?
perhaps db problem ?
i get stress...

pls solve problem please...
KoreanPeople is offline
CrazyHackGUT
AlliedModders Donor
Join Date: Feb 2016
Location: Izhevsk, Russia
Old 06-30-2019 , 07:48   Re: [L4D2] DBResultSet.FetchInt Problem..
Reply With Quote #2

We can't help you because you don't show fully your code.
Also try dump formatted SQL query and execute manually with phpMyAdmin/HeidiSQL/any another sql client.

name - 0.
steamid - 1.
lv - 2.
gold - 3.
exp - 4.
__________________
My english is very bad. I am live in Russia. Learning english language - very hard task for me...

Last edited by CrazyHackGUT; 06-30-2019 at 07:49.
CrazyHackGUT is offline
Send a message via ICQ to CrazyHackGUT Send a message via Skype™ to CrazyHackGUT
I am inevitable
Member
Join Date: May 2019
Location: 0xA6DA34
Old 06-30-2019 , 08:41   Re: [L4D2] DBResultSet.FetchInt Problem..
Reply With Quote #3

Something went wrong when you tried to fetch the data from that specific field (column).

By: "FetchInt(0) = not lv ?", I suppose you expected that fetching the 0 column (first column, counting starts at 0), would give you the value of the second column (actually third, but hey).

As that was your expectation, you used FetchInt, trying to get an int value, while you were actually getting varchar.

A bit as CrazyHackGUT said.
__________________
I do make plugins upon requests, so hit me up on discord if you're interested: Stefan Milivojevic#5311
I am inevitable is offline
KoreanPeople
Junior Member
Join Date: Jun 2019
Old 06-30-2019 , 10:53   Re: [L4D2] DBResultSet.FetchInt Problem..
Reply With Quote #4

Quote:
Originally Posted by CrazyHackGUT View Post
We can't help you because you don't show fully your code.
Also try dump formatted SQL query and execute manually with phpMyAdmin/HeidiSQL/any another sql client.

name - 0.
steamid - 1.
lv - 2.
gold - 3.
exp - 4.
Thx. i solved. really thx
KoreanPeople is offline
KoreanPeople
Junior Member
Join Date: Jun 2019
Old 06-30-2019 , 10:55   Re: [L4D2] DBResultSet.FetchInt Problem..
Reply With Quote #5

Quote:
Originally Posted by I am inevitable View Post
Something went wrong when you tried to fetch the data from that specific field (column).

By: "FetchInt(0) = not lv ?", I suppose you expected that fetching the 0 column (first column, counting starts at 0), would give you the value of the second column (actually third, but hey).

As that was your expectation, you used FetchInt, trying to get an int value, while you were actually getting varchar.

A bit as CrazyHackGUT said.
thx too. i solved.
Problem: DBResultSet.FetchInt(0) = datatype varchar
but, i want to int. so dumbass...
really Thx.
KoreanPeople is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode