fetching logs using a command y_ini
#1

Hello, i just made some logs using y_ini.. But i'm really noob in using yini, and can't use MySQL for logging, tho i know the way of fetching or inputting the value in MYSQL DB..


My question is like, I've made SM Logs.. How can i fetch data? for like i want to fetch last 10 transactions..


and also, how can i fetch last 10 transactions of a particular player?? like i want to fetch the transactions of a player named Div, it will show the last 10 transactions of him.. <= (this one from start, (not coding but theoritically like doing this that, or maybe if u can explain with codes, that would be best)


Fetching last transactions like in MySQL R39, we use "cache_get_field_content" etc..
Reply
#2

Oh..It's really really hard(or impossibly) with y_ini...

For it's MySQL best,why you can't use them?
Reply
#3

they're going to be really large..

I can fetch but idk how to break lines..


It's going to be like


Like, I will make a transactions tables like FROM, TO, AMOUNT, then fetch the content,


How will i break lines?

It will show in a continued series, like

FROM TO AMOUNT
DIV OTHERID $6969 (HOW TO BREAK A LINE HERE?)

and also, how to see MAX transactions only 10?
Reply
#4

MySQL is designed for this sort of thing, why are you reverting to Y_INI?

INI... INI Files... Not really for logging...


Jesus, even the logging plugin uses MySQL IIRC...
Reply
#5

Please can you tell me how do i fetch last 10 Transactions only? Like it will fetch all the transactions done in past by that player.
Reply
#6

That'll be a simple query, that I won't know as I don't get into MySQL, but MySQL is designed for this sort of thing, ESPECIALLY if you are using it to report back a number of results.

Someone will probably throw you a random query which checks for the last 10 results from a database, but it is what MySQL was designed for.

Depends though if they'll spot it seeing as the title says y_ini... Ask a moderator to fix the title if you can't fix it yourself maybe to get it seen better.
Reply
#7

Post the table structure and what needs to be fetched.

Some documentation about what will be required for the query:
Limit rows to N: https://dev.mysql.com/doc/refman/5.5...imization.html
Order by asc/desc: https://dev.mysql.com/doc/refman/8.0...imization.html

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
even the logging plugin uses MySQL IIRC...
It does not. The log plugin is threaded while writing to file but will still need to read from files in PAWN thread to show the last lines and as it was mentioned, this is not suitable*

*reading whole file once to know the number of lines, reading the file for second time to extract only N last lines.
Reply
#8

Well, since ITS for logging purpose, I will need to have it saved, won't be JUST 10 TABLES, BUT I WANT ONLY THE LAST 10 SENT/RECIEVED TRANSACTIONS TO BE SHOWN..


Like there's going to be a command /SMLOG(I made the command /SM)


It will show a dialogbox with the LAST 10 transactions of the player, WHETHER the monney is SENT or RECIEVED..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)