Posts

Showing posts from October, 2025

Module 9: Creating My First MySQL Table

For this module, I worked inside InfinityFree’s control panel and phpMyAdmin to create my first MySQL table. This was a simple assignment, but it’s a key piece of understanding how PHP and databases connect later on. My database is named module9_db , and I built a table called users with an auto-incrementing ID and two text fields for first and last names. Step 1 – Creating the Database I started in my InfinityFree account under MySQL Databases and clicked Create New Database . InfinityFree automatically adds its account prefix, so the final name looked like if0_39835771_module9_db. The process itself was straightforward, no configuration needed beyond giving it a name. Step 2 – Designing the Table in phpMyAdmin Next, I opened phpMyAdmin from the panel to design the table. I named it users and added three fields: id – INT(11), set as the Primary Key and Auto Increment firstname – VARCHAR(50) lastname – VARCHAR(50) Choosing the right data types was the main point here. INT is used for ...

Module 8: PHP Forms and GET vs POST

Link to my site:  http://drew-williams.infinityfree.me/Module8.html For this module, I created an HTML form that collects a user’s first name, last name, and email address. When the form is submitted, it sends the data to a PHP file on the server, which then displays the submitted information back on the page. I used the POST method for this form because it’s more secure and better suited for sending user input that shouldn’t be visible in the URL. I also reviewed the difference between $_GET and $_POST in PHP: $_GET sends data through the URL. You’ll see the variables appear in the query string, like  ?fname=Drew&lname=Williams . It’s fine for search queries or simple data you don’t mind being visible. $_POST sends the data in the body of the HTTP request, so it doesn’t appear in the URL. This makes it better for things like login forms or sensitive data. In my project, the PHP handler uses  $_POST  to grab each value, the...

Modules 6 & 7: PHP Functions and Strings

 Link to my site: http://drew-williams.infinityfree.me/Module7.php For these modules, I created a short PHP page that demonstrates both a custom function and a few string operations. I’ve used PHP before, but it was nice to revisit the basics and set something up from scratch on a hosted server. The function I wrote is called greet(). It takes a first and last name, combines them into a full name, and returns a greeting in uppercase. It’s simple, but it covers the main points from the assignment: parameters, concatenation, returning a value, and using a built-in string function (strtoupper()). Here’s the part I like about PHP, even though it’s an older language, it’s still extremely direct when you just want to manipulate text and send a response to the browser. For the strings part, I included a few examples using built-in PHP functions: strlen() to count the number of characters in a sentence, str_word_count() to count the words, and strpos() to locate a specific word in the stri...