Module #9 Blog


Creating my first MySQL table

I set up a MySQL database on a shared host, created a users table in phpMyAdmin, and hooked an HTML form to it with PHP. I swapped out deprecated MySQL calls for mysqli/PDO, moved to prepared statements, and used password_hash/password_verify — which, unsurprisingly, feels like mandatory work now. I also added server‑side validation and escaped output with htmlspecialchars to limit SQL injection and XSS risks. The trickiest parts were picking field types/indexes (VARCHAR length, whether a field should be TEXT), chasing cryptic connection errors, and fixing smart‑quote bugs copied from Word or tutorials. I checked inserts with the Insert and Browse tabs in phpMyAdmin. Quick tips: use InnoDB and utf8mb4, maintain your database credentials in a config file that isn’t version controlled, turn off detailed errors in production, and never store passwords in plain text. Next, do you want a walkthrough on how to log in and start a session?

Leave a comment