You can use the hash() function to hash your password:
$hashed_password = hash('sha512', $_POST['password']);
Then change your insert statement to insert your hashed password into the database:
INSERT INTO users (username, password, email) VALUES ('$_POST[username]', '$hashed_password', '$_POST[email]');
Remember that your SQL statement is vulnerable to SQL injection, since you are using unanitated user input. To increase security and protect the integrity of your data, please consider shielding and validating your input before using it in an SQL statement. One way to achieve this is through mysqli_real_escape_string() :
$escaped_username = mysqli_real_escape_string( $con, $_POST['username'] ); $escaped_email = mysqli_real_escape_string( $con, $_POST['email'] );
source share