Question: How do you hash a password (hardcode the password to a hash() ) which was already created in combination of the database using php/sql? $conn


How do you hash a password (hardcode the password to a hash() ) which was already created in combination of the database using php/sql?


$conn = mysqli_connect("localhost: 3306", "root","",""); if (mysqli_connect_errno()) { echo " Failed to

$conn = mysqli_connect("localhost: 3306", "root","",""); if (mysqli_connect_errno()) { echo " Failed to connect to MySQL: " } else { } echo " Connected to DB "; // Create database/table and inserts into table $createDB="CREATE DATABASE IF NOT EXISTS testuserdb; "; $createDB.="USE testuserdb;"; $createDB.="CREATE TABLE IF NOT EXISTS users (userName varchar(50) not null primary key, userPassword varchar(255) not null);"; $createDB.="INSERT INTO users (userName, userPassword) VALUES ('joe_bloggs', 'Today123'), ('mark_stevens', 'Tomorrow321"')"; if (mysqli_multi_query($conn, $createDB)) { } else { } mysqli_connect_error() . " "; echo " Database testuserdb and users table created successfully "; do-while loops used to cycle through and process each createDB */ do mysqli_next_result($conn); while (mysqli_more_results($conn)); echo " Error failed to create table. " mysqli_error($conn) ." ";

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To hash passwords in PHP you can use the passwordhash function Heres how you ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!