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

[MySQL] Bigint as string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 11-18-2015 , 00:59   [MySQL] Bigint as string
Reply With Quote #1

is it possible to get "bigint" typed column value as string in sourcemod?

like... getting "SteamID64 bigint" column with SQL_FetchString().
__________________
Starbish is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 11-18-2015 , 04:29   Re: [MySQL] Bigint as string
Reply With Quote #2

Yes.
__________________
Impact123 is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 11-18-2015 , 04:37   Re: [MySQL] Bigint as string
Reply With Quote #3

if table name `table` and line have field `id` = 1 and field `steamid` as bigint, ur code will be
PHP Code:
"SELECT CONVERT(`steamid`, char) FROM `table` WHERE `id` = 1;" 
Kailo is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 11-18-2015 , 04:41   Re: [MySQL] Bigint as string
Reply With Quote #4

Quote:
Originally Posted by Kailo View Post
if table name `table` and line have field `id` = 1 and field `steamid` as bigint, ur code will be
PHP Code:
"SELECT CONVERT(`steamid`, char) FROM `table` WHERE `id` = 1;" 
SQL_FetchString should just work.
__________________
asherkin is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 11-18-2015 , 05:45   Re: [MySQL] Bigint as string
Reply With Quote #5

Thank you for answering.
__________________
Starbish 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 18:08.


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