MySQL related..
#1

Hello, I need help regarding MySQL..

I want to make logging system to make SMLOGS/PMLOGS..


Like I will make a command /SMLOG, I can make it fetch all the SMs of that person.. But thats not how i want..



I want it to fetch the latest 10 transactions or messages :/
Reply
#2

https://www.w3schools.com/sql/sql_autoincrement.asp
https://www.w3schools.com/sql/sql_orderby.asp
https://www.w3schools.com/sql/sql_top.asp
Reply
#3

No role of MYSQL, other than creating tables..


All the transactions will be saved.. BUT ONLY the latest 10 transactions of the player will be SHOWN
Reply
#4

Maybe start by creating a database... That part is self-explanatory, then start adding data that is specific for that person...

So say you have an account table and each person is given a separate ID (via auto-increment), you can use that ID (if you take it and store it for each player that logs in) and put that as one of the Data Values in the database for the SM/PM logs... Then you'll be able to "SELECT * FROM 'TABLE' WHERE User='%d' LIMIT (LIMIT NUMBER)" or as SyS pointed out... Start by learning SQL.

As an example.

ID (Auto-increment) | User (Integer) | (then your other data)
Reply
#5

Thanks, the LIMIT was what i wanted dude! +Rep
Reply
#6

Quote:
Originally Posted by div
Посмотреть сообщение
No role of MYSQL, other than creating tables..


All the transactions will be saved.. BUT ONLY the latest 10 transactions of the player will be SHOWN
The link i posted was not about "creating tables".It's about AUTO_INCREMENT,ORDER BY and LIMIT which is needed for your achieving your goal.The question was too basic therefore i advice you to start learning the language from basics.
Reply
#7

The tables can be created from PHPMYADMIN though, and the code is written above it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)