AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with SQL_FieldNameToNum (https://forums.alliedmods.net/showthread.php?t=308960)

jonatat 07-09-2018 05:40

Problem with SQL_FieldNameToNum
 
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"

Airkish 07-09-2018 08:54

Re: Problem with SQL_FieldNameToNum
 
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) 


Natsheh 07-09-2018 10:39

Re: Problem with SQL_FieldNameToNum
 
PHP Code:

SQL_ReadResult(hQuerydata_username,   pUsername[id], charsmaxpUsername[]) ); 


jonatat 07-09-2018 10:54

Re: Problem with SQL_FieldNameToNum
 
Quote:

Originally Posted by Natsheh (Post 2602286)
PHP Code:

SQL_ReadResult(hQuerydata_username,   pUsername[id], charsmaxpUsername[]) ); 


Hm... Don't get anything with this

Natsheh 07-09-2018 12:17

Re: Problem with SQL_FieldNameToNum
 
Quote:

Originally Posted by jonatat (Post 2602290)
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?


All times are GMT -4. The time now is 21:33.

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