使用已创建的数据库创建插入特定密码哈希值的问题,表

时间:2017-08-01 17:08:17

标签: php mysql pdo

我已经设法在Can I create a database using PDO in PHP的帮助下创建我的数据库和表格,但是我在使用此设置页面插入我的password_hash代码时遇到了困难。

CREATE TABLE `users` (
`user_id` INT(11) NOT NULL AUTO_INCREMENT,
`password_hashcode` VARCHAR(60) NOT NULL DEFAULT '',
 PRIMARY KEY (`user_id`),
INDEX `FK_users_role_status` (`role_id`),
CONSTRAINT `FK_users_role_status` FOREIGN KEY (`role_id`) REFERENCES `role_status` (`role_id`)
 )
 COLLATE='utf8_general_ci'
 ENGINE=InnoDB
 AUTO_INCREMENT=80
 ;

 INSERT INTO `users`(`user_id`, `password_hashcode`) VALUES (1,'$2y$10$g7WTN4QEKH6VxjPX6Wfao.GuxYyIMTi4.E0c8BxJEjJDBkkt73JZO');

For example: '$2y$10**$g7WTN4QEKH6VxjPX6Wfao**.GuxYyIMTi4.E0c8BxJEjJDBkkt73JZO'
'$2y$10**$vrIbKaO5uIreh**.wGtYHn1OU/ttVXnWjZ16ZukPbqngwptawLlleU2'

Undefined variable: g7WTN4QEKH6VxjPX6Wfao

Undefined variable:  vrIbKaO5uIreh

Strangely, I don't get any error with that hash password
 '$2y$10$3awSIi/YVAVierYR79Vj0u9bAsLK00PMaHQAE6We7UWS7SzEavoAq'

如何在不影响密码的情况下插入这些哈希值?

0 个答案:

没有答案