Raised This Month: $ Target: $400
 0% 

How to Get value from Database


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HITLER
Member
Join Date: Jul 2018
Location: www
Old 08-01-2018 , 19:32   How to Get value from Database
Reply With Quote #1

Hello,
First sorry for my bad English

i want code to get Value player_xp from that Table in the photo



i wasted 1 full day in search and trying but it didn't work.
i know someone can do that in 1 min.
i need an example

pleas help me

Last edited by HITLER; 08-01-2018 at 19:41.
HITLER is offline
Send a message via Skype™ to HITLER
LenHard
Senior Member
Join Date: Jan 2016
Old 08-01-2018 , 19:51   Re: How to Get value from Database
Reply With Quote #2

PHP Code:
char[] sQuery = new char[200];        
FormatEx(sQuery200"SELECT `player_xp` FROM `%s` WHERE player_id = \"%s\""TABLEPlayer_Id);
gD_Database.Query(SQL_PlayerXPsQuery); // gD_Database is the Database Handle

public void SQL_PlayerXP(Database hDatabaseDBResultSet hResults, const char[] sError)
{
    if (
hResults == null
        
ThrowError(sError);
    else if (
hResults.RowCount != 1)
        return;
        
    
hResults.FetchRow();
    
hResults.FetchInt(0); // The value

__________________


Currently accepting private requests.
LenHard is offline
Reply


Thread Tools
Display Modes

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 02:25.


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