Switching to MySQL
#1

Is it worth it switching from y_ini to mysql ?
I know its better and stuff but after getting used to y_ini is it better switching to something unknown ?
Reply
#2

MySQL or SQLite, they're the great source for storing your accounts data and other storing things instead of some ordinary library to write files and reading files which is very slow as compared to the loading of rows and fields from the SQL table. Don't use MySQL or SQLite if you have no idea about it because you can easily mess it up and would take time to solve your issues because SQL is a different language. y_ini or any other file saving/loading system is working as a library which is made in PAWN and it's having quite different setup so you obviously won't get that much performance as compared to using MySQL (through plugin) and SQLite (SA-MP have it built-in - no plugins required).
Reply
#3

Unless you want to link your userfiles with a websites (UCP, etc), no.
Reply
#4

I want to store my scriptfiles to a website to have an online banlist and stuff + mysql is better + faster.
The problem is that i dont know how to create a login/register system . I haven't seen a tutorial and i really dont know if i can handle it . Im willing to learn to use mysql .
Reply
#5

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Unless you want to link your userfiles with a websites (UCP, etc), no.
If you would have a bit more knowledge in programming websites you'd know that the command fwrite is available in every programming language.


Switching to MySQL has pros and cons.
if you're interested in more advanced data manipulation and control, then I'd go with MySQL, also MySQL is more secure than fwrite/y_ini, to access a y_ini file you need to -
1. Hack into the FTP
2. Download .ini file
3. Edit.
4. Upload.
Done, you've successfully edited and everything went perfect and easy.
On MySQL on the other hand you'll need to provide user name and password in order to access the MySQL database.

Also, in case where you need to search between hundreds or thousands of users for a specific user, y_ini gets slow, in this case MySQL takes advantage, MySQL is much faster than fwrite in big databases management.


Other than that, if you're not going to send many queries and/or don't want to mess with queries and what is went wrong during the process and that kind of crap, and you'd just prefer to stay with simpler & faster way, go with y_ini.
(Just make it clear, in small databases, fwrite/y_ini is faster)
Reply
#6

Only useful if you're going to take advantage of its structure and functionalities. Sorting, grouping, counting, ...
However, this requires that you know how to properly design the database. A player's data will be scattered around different tables and additionally an individual player may have multiple rows assigned to them, depending on what's being stored. For example, I have this structure for a table that logs all individual sessions:



Which allows me to run this query:
PHP код:
select useridSEC_TO_TIME(SUM(time_logoff time_logon)) AS time_played FROM player_ip_list WHERE userid 1 GROUP BY useridippci 
Which then conveniently returns:
useridtime_played
106:34:25
Reply
#7

Don't convert if you don't know how to use SQL, or if you don't need it. You don't have to convert if your gamemode is small and doesn't control a lot of files and data. Therefore you should convert if you need to use what SQL offers you, rather than what flatfiles systems offer.
Reply
#8

No, not anymore if you're planning to use a UCP.

refer to: http://ca3.php.net/function.mysql-connect
Reply
#9

Quote:
Originally Posted by Mark_Weston
Посмотреть сообщение
No, not anymore if you're planning to use a UCP.

refer to: http://ca3.php.net/function.mysql-connect
No, just no. If you are going to stick to depreciated functions, don't even bother writing anything that involves a database. Use the MySQLi or PDO classes. The MySQLi class is preferred (if you don't intend to switch DBMSs at some point) because it has better performance than PDO (for MySQL), specifically due to the fact MySQLi is designed for MySQL while PDO aims to support multiple DBMSs. They are both equally good though, so no one should judge which you pick!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)