Password Hashing in PHP
Functions for hashing password password_hash() password_verify() password_hash() – Syntax: [code language=”php”] string password_hash(string $password , integer $algo [, array $options ] ) [/code] string $password – Password…
How to use PDO to read data from the database?
1) Write the regular select statement and again, instead of values, put named placeholders. For example: [code language=”php”] $sql = "SELECT * FROM users"; [/code] 2) Prepare…
How to use PDO to insert data into the database?
The SQL code for the users table: [code language=”sql”] CREATE TABLE IF NOT EXISTS users (id int(11) NOT NULL AUTO_INCREMENT, name varchar(60) DEFAULT NULL, phone varchar(12) DEFAULT…
