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

[INC] SQLVault


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-02-2012 , 16:54   Re: [INC] SQLVault
Reply With Quote #101

Quote:
Originally Posted by funfel View Post
If I write "`key2` = 'level'" in sqlv_read_set_ex, sqlv_read_set_ex returns a value for key2 (level) in variable eVaultData[ i ][ SQLVEx_Data ]?
Yes.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
funfel
Member
Join Date: Apr 2011
Old 07-02-2012 , 18:37   Re: [INC] SQLVault
Reply With Quote #102

Ok, thanks, and It returns in string? Or If key2 is num, I receive num? If key2 is float, I receive float? Sorry for dumbish question but I am newbie
funfel is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-02-2012 , 18:37   Re: [INC] SQLVault
Reply With Quote #103

It will always return as a string, regardless if you set as num, float, etc.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
funfel
Member
Join Date: Apr 2011
Old 07-03-2012 , 09:54   Re: [INC] SQLVault
Reply With Quote #104

Problems never die :/ sqlv_read_set_ex works only in last problem (with this "level"), but here it doesnt works (1st place with 600$, second with 1500$, thrid place with 1000$, etc.), so I tried to do Top by sqlv_read_ex, here is the code:

Code:
case _motd_MONEY:
        {
            iLen += formatex( sText[ iLen ], sizeof( sText ) - iLen - 1, "<tr style=^"color:white;background:#0e0e0e;^"><td>#</td><td class=^"l^">Nick</td><td>Cala kasa</td></tr>" );
            
            new iMoney;
            
            for( new i = 0; i < 10; i++ )
            {
                sqlv_read_ex( g_hVault, i, sKey1, sizeof( sKey1 ) - 1, "", 0, sData, sizeof( sData ) - 1, iTimeStamp, "`key2` = 'totalmoney'", "`data` DESC" );
                
                sqlv_get_data_ex( g_hVault, sKey1, "name", sData, sizeof( sData ) - 1 );
                iMoney = sqlv_get_num_ex( g_hVault, sKey1, "totalmoney" );
                
                iLen += formatex( sText[ iLen ], sizeof( sText ) - iLen - 1, "<tr><td>%d</td><td class=^"l^">%s</td><td>%d</td></tr>", i + 1, sData, iMoney );
            }
            
            iLen += formatex( sText[ iLen ], sizeof( sText ) - iLen - 1, "</table></center></body>" );
            
            show_motd( id, sText, "Top10 graczy w calej kasie" );
        }
I cleaned table with "totalmoney", and I with my friend added money for us (500 for me, 1500 for him - for sure we changed map a few times, did much reconnects, and problem is still the same - srsly I dont know what is wrong...

SCREEN:[IMG]http://img855.**************/img855/2286/76823298.png[/IMG] [IMG]http://img854.**************/img854/846/91574257.png[/IMG]

(If I am onerous, I can create a new thread)

Last edited by funfel; 07-03-2012 at 09:55.
funfel is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-03-2012 , 10:17   Re: [INC] SQLVault
Reply With Quote #105

Change your sort clause to this (might not work for local databases since SQLite has quirks):

CONVERT(`data`, DECIMAL) DESC

EDIT:

CAST(`data` AS DECIMAL) DESC

That works for both MySQL and SQLite, so you should just use that one.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 07-03-2012 at 10:22.
Exolent[jNr] is offline
funfel
Member
Join Date: Apr 2011
Old 07-03-2012 , 11:57   Re: [INC] SQLVault
Reply With Quote #106

Now is:
Code:
sqlv_read_set_ex( g_hVault, eVaultMoney, sizeof( eVaultMoney ), _, "`key2` = 'totalmoney'", "CAST(`data` AS DECIMAL) DESC" );
And sometimes all are okey, but sometimes for all places name is empty and money are 0, and sometimes top looks like this old (with didnt sort data)



EDIT: These empty names and money are rare, wrong sorted places too, so I am happy, I am satisfacted (I dont know if this word exists >.<).

Last edited by funfel; 07-03-2012 at 12:46.
funfel is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-03-2012 , 17:13   Re: [INC] SQLVault
Reply With Quote #107

It's like nVault but i try it's better. More easier ! Thx
__________________
Pawn ? Useless
Aooka is offline
funfel
Member
Join Date: Apr 2011
Old 07-04-2012 , 20:04   Re: [INC] SQLVault
Reply With Quote #108

Next easy question to you Exolent - If i wanna delete all values (inserts) for key2 "XXX" I should do:
Code:
sqlv_remove_ex( hVault, "*", "XXX" )
? I am not sure, I read .inc much times and still I am not sure And this remove_ex will clear only table XXX from values?
funfel is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-05-2012 , 09:32   Re: [INC] SQLVault
Reply With Quote #109

Quote:
Originally Posted by funfel View Post
Now is:
Code:
sqlv_read_set_ex( g_hVault, eVaultMoney, sizeof( eVaultMoney ), _, "`key2` = 'totalmoney'", "CAST(`data` AS DECIMAL) DESC" );
And sometimes all are okey, but sometimes for all places name is empty and money are 0, and sometimes top looks like this old (with didnt sort data)

EDIT: These empty names and money are rare, wrong sorted places too, so I am happy, I am satisfacted (I dont know if this word exists >.<).
Really interesting. If you could post your code so I could see how you are saving data, it might help debug it.

The word you were looking for is "satisfied"

Quote:
Originally Posted by funfel View Post
Next easy question to you Exolent - If i wanna delete all values (inserts) for key2 "XXX" I should do:
Code:
sqlv_remove_ex( hVault, "*", "XXX" )
? I am not sure, I read .inc much times and still I am not sure And this remove_ex will clear only table XXX from values?
Yes.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 07-24-2012 , 10:00   Re: [INC] SQLVault
Reply With Quote #110

Quote:
Originally Posted by Exolent[jNr] View Post
Use the sqlv_read_set() and sort by value.
PHP Code:
sqlv_read_set(g_hVaulteVaultDatasizeof(eVaultData) - 1,_,_"desc"); 
you mean like this?
EpicMonkey 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 12:57.


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