Raised This Month: $ Target: $400
 0% 

MySQL Prob


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 05-31-2004 , 06:06   MySQL Prob
Reply With Quote #1

Its 4 am here and im proly making some stupid mistake.

I have a table thats setup like this
steamid | balance | income

here is my code. It is not getting the income data. Always shows 0 when its set to 4.
Code:
public pay() {     client_print(0,3,"Test:1");     new players[32], inum     get_players(players,inum);     for(new i = 0; i < inum; i++)     {         client_print(i,3,"Test:2");         if(minuteI[i])         {             client_print(i,3,"Test:3");             new authid[32],query[256];             get_user_authid(i,authid,31);             format(query,255,"SELECT balance FROM money WHERE steamid='%s'",authid);             if(mysql_query(mysql,query) == 0)             {                 server_print("Query failed!");                 return PLUGIN_HANDLED;             }             new strBalance[32],strIncome[32];             if(mysql_nextrow(mysql) > 0)             {                 client_print(i,3,"Test:4");                 mysql_getfield(mysql,1,strBalance,31);                 mysql_getfield(mysql,3,strIncome,31);                 new balance = str_to_num(strBalance)                 new inc = str_to_num(strIncome);                 format(query,255,"UPDATE money SET balance = %i WHERE steamid='%s'",balance+inc,authid);                 client_print(i,3,"Balance: %i | Income: %i  | Balance + Income: %i / %s",balance,inc,balance+inc,authid)                 if(mysql_query(mysql,query) == 0)                 {                         server_print("Query failed!");                         return PLUGIN_HANDLED;                 }             }         }     }     return PLUGIN_HANDLED; }
Freecode is offline
 


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


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