cache_get_value... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: cache_get_value... (
/showthread.php?tid=624417)
cache_get_value... -
GoldenLion - 16.12.2016
Hi, what's the difference between cache_get_value and cache_get_value_name, cache_get_value_int and cache_get_value_name_int and so on in MySQL?
Re: cache_get_value... -
DetoNater - 16.12.2016
Its the function which fetches the data stored by your query..... name means string, obiously, int means integer amd so on.... just check some example code's usage somewhere and u'll know the purpose of usage then..
you can check wiki here
https://sampwiki.blast.hk/wiki/MySQL/R40
Re: cache_get_value... -
GoldenLion - 16.12.2016
I know what they are for, but I'm asking the
difference between them.
Код:
cache_get_value
cache_get_value_name
cache_get_value_int
cache_get_value_name_int
cache_get_value_float
cache_get_value_name_float
Re: cache_get_value... -
Vince - 16.12.2016
One gets the results by column index (0, 1, 2, ...) the other gets them by name ("id", "name", "level", ...).
Re: cache_get_value... -
Konstantinos - 16.12.2016
cache_get_value_index gets the results by column index whereas cache_get_value (macro) accepts both column index or column name.
Re: cache_get_value... -
GoldenLion - 16.12.2016
Right, but there are 3 of them like cache_get_value_index, cache_get_value_name, cache_get_value. What's the difference between cache_get_value_name and cache_get_value?
Re: cache_get_value... -
Runn3R - 16.12.2016
There is no cache_get_value. Atleast no in the mysql wiki: (click the fnames for the wiki page)
cache_get_value_name:
cache_get_value_name(0, "name", dest);
Selects a row by a column name and loads it into the destination array(in this case).
cache_get_value_index:
Selects a row by a column number and loads it into the destination array(in this case).
cache_get_value_index(0, 0, dest);
Performance wise the index one is faster hence it doesn't need to check the column name and compare it to what did you type in. But the index is way messy.
Re: cache_get_value... -
GoldenLion - 16.12.2016
Quote:
Originally Posted by Runn3R
There is no cache_get_value.
|
https://github.com/pBlueG/SA-MP-MySQ...stem-cache.pwn - that's MySQL R40.
Re: cache_get_value... -
Runn3R - 16.12.2016
It's probably a macro or a redefinition.
Try adding cache_get_value_int and it will work just as cache_get_value_name_int
Re: cache_get_value... -
Runn3R - 17.12.2016
Quote:
Originally Posted by maddinat0r
cache_get_value is just a comfort function (macro actually). Based on the input parameters you provide, it automatically resolves to cache_get_value_name or cache_get_value_index, e.g.:
Код:
cache_get_value(0, 0, data); // translates to cache_get_value_index
cache_get_value(0, "field", data); // translates to cache_get_value_name
new idx;
cache_get_value(0, idx, data); // translates to cache_get_value_index
new field[32] = "field2";
cache_get_value(0, string:field, data); // translates to cache_get_value_name
|
Just a macro.