AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [INC] SQLVault (https://forums.alliedmods.net/showthread.php?t=146849)

Exolent[jNr] 01-03-2011 00:28

Re: [INC] SQLVault
 
Quote:

Originally Posted by gladius (Post 1384979)
Nice work that helpful very much to all people who don't know how to use SQL.

Mmmm I think you can do this more functionally. (something how work sorting.inc) For example: if someone makes a "top15", it is required to order.
I use this. SQL_PrepareQuery(Sql_Connection, "SELECT authid FROM `kzcl_pro15` WHERE mapname='%s' ORDER BY time LIMIT 15", mapname) bla bla bla

And why when you put something on the "vault" and it is not there, you use REPLACE instead of INSERT? is better? (I always use insert in such cases, then I want to know :D)

Thanks. That was the main goal of these includes.

You can use the read all function and then sort the cell array.

REPLACE will update when the primary key is found to be a duplicate from the one being inserted, and a new entry will be entered if the primary key does not exist.
It is basically the same as using INSERT INTO and the ON DUPLICATE KEY UPDATE clause.

gladius 01-03-2011 01:09

Re: [INC] SQLVault
 
Yes, I did not think so. Now I read read all function, I understood.

Well, this was only a suggestion: D And i know if you want to use it, You need to know something more than the basics. But what happens to the protagonists of this thread(medium - low level programming) do you think that he know how to mix with sorting. Remember sorting is not easy to use, half complicated if this is your first time using it.(or to me) but I think if you do that, you need to modify the code a "bit much". :P

Yes, i know this is to everybody, not just specific people, but as I said, it's only a suggestion :D

I'm glad that someone has taken the time to do this.

Exolent[jNr] 01-03-2011 01:13

Re: [INC] SQLVault
 
Sorting is not hard at all, actually.
I'm not just saying that because I'm experienced in it either.
AMXX has sorting functions which makes things easier and is very easy to understand.
In this case, ArraySort() would be used and there are plenty examples to help people who have never used it.

gladius 01-03-2011 01:30

Re: [INC] SQLVault
 
haha found only replys from you, using ArraySort: D

Well I never used ArraySort, so now I will see and if I understand it, maybe I will make an example of how to make a top15: D (sql + sort)

Jacob 01-03-2011 06:29

Re: [INC] SQLVault
 
nicely done;
awesome;
+karma!!!!!!!!

YakumoHiratsuhi 01-04-2011 12:40

Re: [INC] SQLVault
 
Fan-fuckin-tastic:up: really nice job exolent.

wrecked_ 01-04-2011 21:42

Re: [INC] SQLVault
 
Quote:

Originally Posted by gladius (Post 1384994)
Well, this was only a suggestion: D And i know if you want to use it, You need to know something more than the basics. But what happens to the protagonists of this thread(medium - low level programming) do you think that he know how to mix with sorting. Remember sorting is not easy to use, half complicated if this is your first time using it.(or to me) but I think if you do that, you need to modify the code a "bit much". :P

Watch this video. There are 5 in the set, but this will hopefully take away that mystery behind sorting and how to do it. It's not Pawn-specific, but it is easily translated over.

I was considering making a tutorial on this and implementing it into a ranking system, but I feel it will not do much good. Most intermediate-level programmers will not be able to grasp qsort, and the ones that are able to will probably have already had some experience with it. Bubblesort and insertion sorting are less efficient and may not be worth teaching in a full tutorial.

EDIT: Sorry, got a bit off-topic.

AntiBots 01-05-2011 19:55

Re: [INC] SQLVault
 
WoooowWW, Exelent Work.!!

eXacT 01-08-2011 22:30

Re: [INC] SQLVault
 
Thanks a lot, it is very helpfull for my =D

drekes 01-18-2011 12:33

Re: [INC] SQLVault
 
I have a problem using this.
I've created another plugin using this and it works fine.
But now it keeps saying the SQlite isn't enabled. i can't figure this out.

in my plugin:
PHP Code:

g_Vault sqlv_open_local("Shop_Vault"); 

When i start the server:
Code:

L 01/18/2011 - 18:26:02: [test.amxx] SQLite module needs to be enabled in modules.ini to open local database
amxx modules:
Code:

Currently loaded modules:
      name                    version    author              status   
 [ 1] SQLite                  1.8.1.3746  AMX Mod X Dev Team  running   
 [ 2] Fun                    1.8.1.3746  AMX Mod X Dev Team  running   
 [ 3] CStrike                1.8.1.3746  AMX Mod X Dev Team  running   
 [ 4] CSX                    1.8.1.3746  AMX Mod X Dev Team  running   
 [ 5] Ham Sandwich            1.8.1.3746  AMX Mod X Dev Team  running   
 [ 6] FakeMeta                1.8.1.3746  AMX Mod X Dev Team  running   
 [ 7] Engine                  1.8.1.3746  AMX Mod X Dev Team  running   
7 modules, 7 correct

modules.ini
Code:


;;;
; To enable a module, remove the semi-colon (;) in front of its name.
; If it's not here, simply add it its name, one per line.
; You don't need to write the _amxx part or the file extension.
;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL Modules usually need to be enabled manually ;;
;; You can have any number on at a time.  Use      ;;
;;  amx_sql_type in sql.cfg to specify the default ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;mysql
sqlite

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Put third party modules below here.              ;;
;; You can just list their names, without the _amxx ;;
;;  or file extension.                              ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; These modules will be auto-detected and loaded  ;;
;;  as needed.  You do not need to enable them here ;;
;;  unless you have problems.                      ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

fun
;engine
;fakemeta
;geoip
;sockets
;regex
;nvault
cstrike
csx
;hamsandwich

Sorry if this has nothing to do with your include,
i'm still new to this stuff. :oops:


All times are GMT -4. The time now is 15:14.

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