Thread: [INC] SQLVault
View Single Post
t3hNox
Senior Member
Join Date: Oct 2009
Old 03-17-2012 , 15:14   Re: [INC] SQLVault
Reply With Quote #47

I'm using the extended version of this vault include.
What would be the best way to find out whether a specific 2nd key value already exists.

To clerify:
sqlv_set_num_ex(g_Handler, szName , "online", iData)
sqlv_set_num_ex(g_Handler, szName , "id", iSomeID)

How can I determine if iSomeID already exists somewhere in the vault as the second key ("id"), no matter what the first key is (in this case szName) ?

I hope it's possible without irritating through the whole vault.


edit: I think I found a solution by looking at the example plugin.

Code:
new Output[3][SQLVaultEntryEx] // I actually only need to know if there is at least one entry matching the query (below) new iTotalEntries = sqlv_read_set_ex(g_Handler, Output, sizeof(Output), 0, "`id /* second key */` = iSomeID", "`id` DESC" /* DESC doesn't really matter */)

Would iTotalEntries contain the count of found entries ? Does it work like that ?

Last edited by t3hNox; 03-17-2012 at 16:14. Reason: edit.
t3hNox is offline