Weekly Recap | March 3, 2011
Lecture Notes
- Announcements
- Review of Project 3 – Navigation & Sitemaps with PHP Server side includes - review some student projects – the jquery sliding footer
- Review of MySQL Database fundamentals
- Dreamweaver Server Behaviors with PHP & MySQL
Assignments
- Lesson 6 in Training From the Source
- Project 4 is due Sunday March 13 at midnight – create a website with several internal pages that are password-protected using the server behavior techniques on pages 170-192 Lesson 6. Include at least one page that lists the users table rows (using the recordset behavior explained on pages 192-197.)
- Quiz 2
Question from Lesson 6 – I could not get the php password encryption code on p. 191 to work. Will we be covering this in class this week?
A php error showed up later in the document around line 69.
Yes, we will be going over the encryption method in class tomorrow.
The add_user.php at the url above works only one time. When I add another user I get this error message: ‘Duplicate entry ’0′ for key 1′. I looked at some blogs about this error and tried some things but it’s beyond me as to what to do to fix it. Any help?
Linda – It sounds like you are trying to insert a row with a value for userid, which is an auto-increment column and you should not set it using Dreamweaver/PHP. It will be set automatically by MySQL when new records are inserted.
I haven’t done anything using Dreamweaver/PHP that I’m aware of. I just followed the book pgs. 177 to 183. What makes you think I am trying to insert a row with a value for userid? What do you see and where do you see it? Can you tell me how to fix it?
Linda – make sure the AI (auto increment) is checked in the user_id column of your mySQL users table.
Linda – The problem in your Insert Record Server Behavior – what does it say about the ‘user_id’ column? It should say: “‘user_id’ is an Unused Primary Key.”
Yep. That’s what it says.
This is the info in the user table:
`user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
user_id should also be the Primary Key for the users table.