I’m always thinking, “I should finish my Presidents project,” but always putting it off because there’s something more urgent like FreeCodeCamp, Codecademy, CS50, etc. but today I decided to do something fun, productive, etc. and not stress out about that stuff–returned to the Prez project and PHP. Because, “Finish my PHP, forms, and SQL tutorials” is another frequent thought.
Today’s first update went swimmingly–after a user adds a new president, they’re returned to the List O’ Presidents. That’s what the “Edit a Prez” page/form does and now so does the Push/Add Prez form. Yay, me.
While looking at the code for New/Submit/Add and the code for Edit/Update, I noticed that I’d written some security & validation into the Edit form but not the Add form which seems backward at best. It looked as if all I needed to do was copy from one file to the other, replacing the code (exactly what I did with delightful results for sending the user back to the main list page).
The Internet didn’t like that. I got an error about MySQL syntax that I didn’t really understand referring to a line that didn’t seem, to me, at all relevant.
Putting lines 15-19 back the way they were didn’t seem to help (but that may have been because Dreamweaver frequently decides to stop uploading stuff properly) so I uploaded an earlier version without the new code at lines 48-49, and then re-updated those lines so we (FoyKitty and I) are all happy again.
I’ve decided to not spend all of this Saturday troubleshooting that as I have long To-Do and Wish lists (and my wife has her own To-Do list for me as well). I’ll get back to this once I’ve learned a bit more about both PHP and SQL–that might make it obvious and easy when I come back to it.