Login & Register system issue
#1

I'm a new scripter, and it's really hard for me to create a login & register system with y_ini...
Is it really the easiest way to make such a system?

Note: I don't care whats better, I just want to know what's the easiest because I'm learning...
Thanks in advanced!
Reply
#2

Not sure, SQL is easier for me. Depends on your preference I guess.
Reply
#3

Using ini will be easier because the principle isn't that hard either
just a file with headers/tags and key=value under it

filename.ini
pawn Код:
[users]
name=Ramboi
password=unsafePassword
In my opinion, SQL might be a harder way to go, because it contains terms which need more understanding, reading and practice.
ini is a more familiar approach in my opinion because people are more familiar with creating a .txt file and editing them.

the only thing you might be stuck with getting around is "headers" aka "tags"
which as I wrote in the example above, just groups the key and value.

Nevertheless, after learning ini, it might serve as a gate to learning the basics of sql
Reply
#4

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
Using ini will be easier because the principle isn't that hard either
just a file with headers/tags and key=value under it

filename.ini
pawn Код:
[users]
name=Ramboi
password=unsafePassword
In my opinion, SQL might be a harder way to go, because it contains terms which need more understanding, reading and practice.
ini is a more familiar approach in my opinion because people are more familiar with creating a .txt file and editing them.

the only thing you might be stuck with getting around is "headers" aka "tags"
which as I wrote in the example above, just groups the key and value.

Nevertheless, after learning ini, it might serve as a gate to learning the basics of sql
SQL (for what a beginner needs it for) is in no means any harder than implementing Y_INI (I actually find INI more "complicated?" and frustrating), at least SQLite (MySQL is a bit more extensive). Remember that a beginner doesn't simply magically write code, they most likely get code from tutorials/documentation. All one needs to do really is learn how to write SQL statements.
Reply
#5

Quote:
Originally Posted by Paulice
Посмотреть сообщение
SQL (for what a beginner needs it for) is in no means any harder than implementing Y_INI (I actually find INI more "complicated?" and frustrating), at least SQLite (MySQL is a bit more extensive). Remember that a beginner doesn't simply magically write code, they most likely get code from tutorials/documentation. All one needs to do really is learn how to write SQL statements.
You answered yourself why it will be hard to implement SQL into a script.

This is rather starts to be an in-acknowledgement in the difference between editing ini and sql.

ini requires zero configuration. zero setup. its simply a plug-n-play.
You not need to mass with sys administration, ini playground consists of native functions such as fopen, fwrite, fread and fclose which work on win and linux with no need of pre-installation.

Nevertheless, with ini files you don't need to worry about table structure, its efficiency, authorization, compression, joins, keys, field(column) type, field defaults, and although most probably events won't be touched, but its also a feature which can be utilized.

Yet, in ini you don't need to set any of that.
Upon every ini function, the code will be similar (relevant to y_ini) which is basically open the file, choose a header/tag to follow and read/write the key=value


SQL has far more steps than an ini file.


Moreover, you mentioned a "copy paste" code, which queries is not at all one of these kinds.
Writing queries requires acknowledgement of what your current table structure is, what columns exists on his setup and what's their type. SQL is far beyond than those just "select", "update", "delete" and "insert"
`` All one needs to do really is learn how to write SQL statements.``

Nevertheless, (in mysql) people then need to learn the difference between a query which uses the main thread, separate thread and in a pool. (mysql_query, mysql_tquery, mysql_pquery)
Then (in any rdbms) they'll need to understand what is escaping, when to use it and why it exists.
with ini, you won't need to learn any of these.

Still, ini is a plug and play.


Of course you can go with the basics of SQL, use SQLite to avoid installing RDBMS software on your machine (afaik SQLite comes pre-installed on Windows), not know what is the difference between SQLite and MySQL because its not explained on tutorials and use the same table for the rest of your project's life, yet the learning curve here is in my opinion is far less steep than with ini.
Reply
#6

Don't start off with something outdated and unsuitable (as alex said), there are plenty of tutorials on this same forum about login/register using mysql or sqlite.

I agree with whatever Alex said but you don't really have to know a lot of things to start off with SQL, most of important things are stated in tutorials emselves.
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
While I do agree that for anything more complex than basic configuration options and management, INI is unsuitable (despite me having written a user system based on it, I always wanted to upgrade to SQL), you basically just said "SQL is easier than INI - all you need to do is learn two languages instead of one". The "L" in "SQL" means "language", there is far more to it than just "SELECT" and "INSERT". If those are the only commands you are using, you are probably doing it wrong. If you have a column name with a number in it, you are probably doing it wrong. If you have not added keys and indexes, you are probably doing it wrong. IMHO if you ever use "DELETE", you are probably doing it wrong.

I'm not saying don't learn SQL, I'm just saying treat it as what it is - a whole language with its own syntax, rules, and optimisations. I've seen people worrying way too much about "optimisation" in PAWN, asking questions like which is faster - "if" or "switch", but then using truly terrible SQL without an index in sight. I guarantee that will affect your performance far far more than any micro optimisations in PAWN ever could.

In short, don't write a user system, find and use an existing reliable one, unless you already know a lot about databases and cryptography - I've only listed problems with databases here, but there are just as many issues (that again most people get wrong) with securing passwords.
For what a starting user needs it for, SELECT, UPDATE INSERT INTO and LIMIT are the only clauses they need to learn how to use. PRIMARY KEY and AUTO_INCREMENT can be taught to configure in phpMyAdmin. Starting users don't really know how to script so they won't be adding features that require other clauses (to balance it out), and furthermore, the performance will be fine.

As they aquire more knowledge, it saves them the time in converting their script. Time is the last thing one should waste (I don't find learning a waste of time though), developers often drop projects due to lack of time. MySQL may be more complex to use, but there's always SQLite (which has simple functions). SQL should replace INI soon.

With a proper tutorial I do believe they can eventually learn without busting a brain cell.
Reply
#8

Quote:
Originally Posted by Paulice
Посмотреть сообщение
For what a starting user needs it for, SELECT, UPDATE INSERT INTO and LIMIT are the only clauses they need to learn how to use. PRIMARY KEY and AUTO_INCREMENT can be taught to configure in phpMyAdmin. Starting users don't really know how to script so they won't be adding features that require other clauses (to balance it out), and furthermore, the performance will be fine.

As they aquire more knowledge, it saves them the time in converting their script. Time is the last thing one should waste (I don't find learning a waste of time though), developers often drop projects due to lack of time. MySQL may be more complex to use, but there's always SQLite (which has simple functions). SQL should replace INI soon.

With a proper tutorial I do believe they can eventually learn without busting a brain cell.
You almost decide for them what they won't do, while its half untrue.
People start to learn things, because they want to add features in the first place.

`the performance will be fine`
same applies to ini.

I think you're accepting ini as a file system which is slow and "hard to understand".
Which is kinda true in terms of speed, but it isn't something that noticeable if you are playing with small data, eventually you'll know when to upgrade when things start to slow down.

`SQL should replace INI soon`
It has been said for ages. yet, you can open the `Scripting Help` board now, and see that people are even using dini.


You have a point about the time being saved learning SQL instead and starting off with it.
But as the first post says
Quote:

Note: I don't care whats better, I just want to know what's the easiest because I'm learning...

Reply
#9

In my opinion SQL isn't a good start for me.
So should I go with .ini?
Reply
#10

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
But as the first post says
As I said, SQL statements (again for what a starting user needs it for) aren't hard to write. It's almost as writing pseudocode.

Код:
SELECT sql_id FROM users WHERE username = Paulice LIMIT 1
I don't want to carry this discussion on any further, but SQLite is fairly simple in my opinion and I believe people should start off with it instead of INI.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)