Resuming PHP Schooling

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.

foyCoder.png

The Foy-Kitty (aka “Daisy”) helping me study

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.

However …

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).

comparingCode.png

Replaced lines 15-19 with lines 164-168

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.

Advertisements

About jotascript

Aiming to please. Seeking to impress.
This entry was posted in myProjects, MySQL, PHP. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s