Prevent multiple login of same account with PHP

Sometimes required to restrict the user to only log in on a single system or a browser at a time.

To prevent the user from login on multiple systems or web browsers you need to generate a token on each successful login attempt.

Need to check the token on each page. If the token does not match then destroy the SESSION and log out the user.

In this tutorial, I show how you can prevent multiple logins of the same user with PHP.

Prevent multiple login of same account with PHP

Read more

Connect to multiple MySQL databases with PHP

Within the project sometimes requires using multiple MySQL databases. It may be the existing database from another project or the new one.

To handle this with PHP requires to create separate connections for each database and use the connection accordingly while manipulating data in MySQL database.

Connect to multiple MySQL databases with PHP

Read more

How to create and manage a MySQL Database in cPanel

From cPanel you cannot directly create or upload your database using PHPMyAdmin while making your website live. You need to follow some of the steps like – creating a database, user, etc.

The cPanel gives easy to use interface that makes it easier to manage the database and make it available in the PHPMyAdmin.

In this tutorial, I am assuming that you already have a cPanel enabled web hosting server.

How to create and manage a MySQL Database in cPanel

Read more

Update records in Database Table with CodeIgniter

The Codeigniter allows us to perform the database action like – select, insert, update, and delete with the minimal script.

The $this->db->update() method is used for update existing record. It takes table name and an array or object as the parameter.

In the demonstration, I am listing the user’s list with the edit option. Show the update form on edit option-click.

Update records in Database Table with CodeIgniter

Read more