Raised This Month: $ Target: $400
 0% 

One thing with SQLx


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lunarwolfx
Member
Join Date: Feb 2005
Old 01-05-2007 , 17:46   Re: One thing with SQLx
Reply With Quote #1

Code:
public hrp_is_job_higher(id,authid[],jobid[]) {     new data[2]; format(data,1,"%d",id); static query[256];     format(query, 255, "SELECT job>%s FROM users WHERE steamid='%s'",jobid,authid);     SQL_ThreadQuery(sql_get_handle(),"QueryHandle", query,data,1) } public hrp_is_job_smaller(id,authid[],jobid[]) { new data[2]; format(data,1,"%d",id);     static query[256]; format(query, 255, "SELECT job<%s FROM users WHERE steamid='%s'",jobid,authid);   SQL_ThreadQuery(sql_get_handle(),"QueryHandle", query,data,1) } public QueryHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize) {     //Thanks Hawk552 <3     if(FailState == TQUERY_CONNECT_FAILED)          return set_fail_state("[HRPi]SQL Connection Failed.")     else if(FailState == TQUERY_QUERY_FAILED)          return set_fail_state("[HRPi]Query failed.")         if(Errcode)          return log_amx("[HRPi]Error on query: %s",Error)         server_print("[HRPi] SQL Query Executed Successfully!")      if(SQL_NumResults(Query)) {         new id = str_to_num(data)        StoreSomeWhere[id] = SQL_ReadResult(Query, 0);     }      return Handle:Query }

Sorry for the lack of indenting.

Try to pass your id through data, and make StoreSomeWhere an array.


change this:

Code:
if(!hrp_is_job_higher(id,pid,2) && !hrp_is_job_smaller(id,<,pid,11))

to this:


Code:
if(!StoreSomeWhere[id] > 2 && !StooreSomeWhere[id] <11))

Last edited by lunarwolfx; 01-05-2007 at 17:48.
lunarwolfx 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 22:27.


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