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

Problem with SQL_FieldNameToNum


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonatat
Senior Member
Join Date: Dec 2017
Old 07-09-2018 , 05:40   Problem with SQL_FieldNameToNum
Reply With Quote #1

I need take out username from mysql my this:

PHP Code:
new data_username SQL_FieldNameToNum(hQuery"username");
pUsername[id] = SQL_ReadResult(hQuerydata_username); 
formatex menu:

PHP Code:
formatex(usernamecheckcharsmax(usernamecheck), "Player: %s"pUsername[pevPlayer]); 
But i'm getting only 0 or 1, but not username. Why?

Example: Should be "NickNAme1". Getting: "0"

Last edited by jonatat; 07-09-2018 at 07:30.
jonatat is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 07-09-2018 , 08:54   Re: Problem with SQL_FieldNameToNum
Reply With Quote #2

PHP Code:
 pUsername[33][32
You don't need fieldnametonum

Do this:

PHP Code:
 SQL_ReadResult(hQuery1pUsername[id], 32); // change 1 to your column number (starting from 0) 

Last edited by Airkish; 07-09-2018 at 09:29.
Airkish is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-09-2018 , 10:39   Re: Problem with SQL_FieldNameToNum
Reply With Quote #3

PHP Code:
SQL_ReadResult(hQuerydata_username,   pUsername[id], charsmaxpUsername[]) ); 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-09-2018 at 10:40.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
jonatat
Senior Member
Join Date: Dec 2017
Old 07-09-2018 , 10:54   Re: Problem with SQL_FieldNameToNum
Reply With Quote #4

Quote:
Originally Posted by Natsheh View Post
PHP Code:
SQL_ReadResult(hQuerydata_username,   pUsername[id], charsmaxpUsername[]) ); 
Hm... Don't get anything with this
jonatat is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-09-2018 , 12:17   Re: Problem with SQL_FieldNameToNum
Reply With Quote #5

Quote:
Originally Posted by jonatat View Post
Hm... Don't get anything with this
Well depends on when you are using it, am i suppose to know why with the given code?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 11:32.


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