1

I'm using the 1-file version of this project: http://php-login.net

It uses a sqlite *.db file to store the info.

Will it cause issues if two users are trying to register at the same time? Permission errors, etc.? I'm unsure how PHP handles multiple requests happening at once.

4
  • Just set a primary key, or set a column as UNIQUE. Commented Dec 15, 2014 at 16:32
  • I'd hope the library he's chosen is doing that already. Commented Dec 15, 2014 at 16:34
  • @quickshiftin OP should be all set then ;) Commented Dec 15, 2014 at 16:37
  • 1
    possible duplicate of sqlite3 concurrent access Commented Dec 16, 2014 at 17:14

1 Answer 1

2

It will work just fine. PHP runs inside of webservers that handle the work of multiple simultaneous requests. SQLite is also capable of handling multiple simultaneous requests, albeit not as many as a propers SQL server like MySQL.

EDIT

I just checked... The one-file version of PHP-login does have a primary key.

$sql = 'CREATE TABLE IF NOT EXISTS `users` (
        `user_id` INTEGER PRIMARY KEY,
        `user_name` varchar(64),
        `user_password_hash` varchar(255),
        `user_email` varchar(64));
        CREATE UNIQUE INDEX `user_name_UNIQUE` ON `users` (`user_name` ASC);
        CREATE UNIQUE INDEX `user_email_UNIQUE` ON `users` (`user_email` ASC);
        ';
Sign up to request clarification or add additional context in comments.

6 Comments

Using a PK is what OP should use.
Pay a little more attention my man, he's using a library that already provides an FK!
I don't have to "pay more attention". As if I'm going to go through every single link an OP posts to see whether or not he/she did use the actual SQL included in there. So, we don't know that for sure, now do we? There you go. Without even checking that link, my first comment to the OP "answered" the question. Why even put in an "answer"?
I don't think your comment did answer the question, in fact I think it brought up an unrelated subject... And anyway, you can see in 2 seconds that there is a PK already defined lol, so yes, pay more attention.
thanks both of you! :) i didn't know sqlite could handle multiple requests - i didn't know if it'd be like two users trying to edit a Word file on a local network share.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.