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

[TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)


Post New Thread Reply   
 
Thread Tools Display Modes
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-08-2007 , 00:17   Re: SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #11

Geez. You weren't kidding when you said "a hell of a lot more code".
Bad_Bud is offline
Old 01-08-2007, 00:35
SweatyBanana
This message has been deleted by Brad. Reason: spam
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 01-08-2007 , 15:20   Re: SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #12

good article imo, thanks hawk
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
Coksnuss
Junior Member
Join Date: Feb 2007
Old 05-02-2007 , 13:27   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #13

Nice Tut...
Too bad dbi is outdated because its alot easier to handle then this ****.
Coksnuss is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-02-2007 , 19:46   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #14

Quote:
Originally Posted by Coksnuss View Post
Nice Tut...
Too bad dbi is outdated because its alot easier to handle then this ****.
Please, think before you say something. It's roughly the same in the areas they both have support for. The reason SQLx is harder is because it's capable of so much more. If you want to use DBI, go ahead, but I recommend that you don't.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
TheNewt
Donor
Join Date: Jun 2006
Location: Where I live.
Old 05-02-2007 , 23:07   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #15

Quote:
Yeh, thanks Hawk, now i actually know some SQL (I wouldn't even went to SQL side of AMXx stuff, but i got drawn to it by this
lol, you don't know SQL, you know how to connect to a SQL server database using the SQL functions in AMXX, but you don't know SQL.
If you knew SQL, you'd know how to connect two seperate databases, to search for an item that has correlations between two different tables. Assuming one table being player XP and the second table being player Class, then the second database could be a seperate server you have. So maybe you want to search for a player on two servers and connect his XP/Class, but I don't think you know how to do that from memory. :O
__________________
Quote:
toe3_ left the chat room. (G-lined (AUTO Excessive connections from a single host.))
TheNewt is offline
Old 05-06-2007, 22:14
Hawk552
This message has been deleted by Hawk552.
Rolnaaba
Veteran Member
Join Date: May 2006
Old 05-07-2007 , 08:16   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #16

Quote:
Originally Posted by MysticDeath View Post
lol, you don't know SQL, you know how to connect to a SQL server database using the SQL functions in AMXX, but you don't know SQL.
If you knew SQL, you'd know how to connect two seperate databases, to search for an item that has correlations between two different tables. Assuming one table being player XP and the second table being player Class, then the second database could be a seperate server you have. So maybe you want to search for a player on two servers and connect his XP/Class, but I don't think you know how to do that from memory. :O
I am pretty sure he meant with amxx, and not actuall SQL cut him a break.

FYI hawk your sig's saying is wrapping:
Attached Thumbnails
Click image for larger version

Name:	sig.GIF
Views:	435
Size:	16.0 KB
ID:	15965  
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 05-07-2007 at 08:19.
Rolnaaba is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-07-2007 , 14:55   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #17

Quote:
Originally Posted by Rolnaaba View Post
I am pretty sure he meant with amxx, and not actuall SQL cut him a break.

FYI hawk your sig's saying is wrapping:
I know, been too lazy to deal with it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 05-15-2007 , 05:35   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #18

Quote:
Originally Posted by Hawk552 View Post
SQLx is harder is because it's capable of so much more.
Or... because it's a logic rapist, because almost every time you read in a value, the threadquery is generally the last thing you do in the function that calls the threadquery, because the code then has to shift over to a handling function for when Amxx recieves the callback, so instead of having:
PHP Code:
Function(LOL)
{
    new 
Variables
    Variables
=Do some SQL in this function
    
client_print(LOL,print_chat,"%d",Variables)

You end up with:
PHP Code:
Function(LOL)
{
    New 
Data[1]
    
Data[0]=LOL// :*C
 
    
Do some query making[].
    
SQL_ThreadQuery(Stuff,"MyCuteHandler","MyQuery",myData,1)
}
 
MyCuteHandler(WTF STUFF HERE)
{
 
    
COPY AND PASTED ERROR CHECKS()
 
    if(
SQL_MoreResults(Query))
    {
        
client_print(Data[0],print_chat,"%d",SQL_ReadResult(Query,0))
    }

For essentially the same thing. That's why SQLx is "harder". It completely rearranges your code and thought process, kind of...
__________________
Bad_Bud is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-15-2007 , 05:59   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #19

You left out the error checking in the first block, because there should always be error checking for SQL. It makes perfect sense IMO, you just can't run a threaded query the way you want it to.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Drak
Veteran Member
Join Date: Jul 2005
Old 12-22-2008 , 01:36   Re: [TUT] SQLx - the newest AMXX SQL driver set (advantages and usage)
Reply With Quote #20

Question. I want to use threaded queries for this. How would I go about accomplishing this? Due to the fact, I need to return the value soon as a player connects. Would I have to make a delayed task, and check a value?

Code:
public client_connect(id)      if(!IsBetaTester(id))           // Kick them here bool:IsBetaTester(id) {     new AuthID[36],bool:Tester = false     get_user_authid(id,AuthID,35);         new ErrorCode,Error[128],Handle:g_SqlConnect = SQL_Connect(g_SqlHandle,ErrorCode,Error,127);     new Handle:Query = SQL_PrepareQuery(g_SqlConnect,"SELECT * FROM BetaTesters WHERE SteamID='%s'",AuthID);         if(!SQL_Execute(Query))         return false         if(SQL_NumResults(Query) < 1)         Tester = false     else         Tester = true         SQL_FreeHandle(Query);         return Tester }
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
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 02:33.


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