Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP User Authentication Adding Authentication to Your Application Securing Passwords

Securing Passwords - Error

" Notice: Use of undefined constant PASSWORD_DEFUALT - assumed 'PASSWORD_DEFUALT' in /home/treehouse/workspace/procedures/doRegister.php on line 17

Warning: password_hash() expects parameter 2 to be integer, string given in /home/treehouse/workspace/procedures/doRegister.php on line 17

Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 19 users.password may not be NULL in /home/treehouse/workspace/inc/functions.php:129 Stack trace: #0 /home/treehouse/workspace/inc/functions.php(129): PDOStatement->execute() #1 /home/treehouse/workspace/procedures/doRegister.php(19): createUser('lightsnoon99@gm...', NULL) #2 {main} thrown in /home/treehouse/workspace/inc/functions.php on line 129"

I wrote everything she wrote, literally going through this 3 times without finding a single error on my code. Here's the snapshot, http://w.trhou.se/63dz4kxskx godspeed

1 Answer

It's literally telling you on the first line.

You've spelled PASSWORD_DEFAULT wrong.