Nice to meet you, PHP!

swishyfishie2

Swishyfishie

Posted on December 5, 2020

Nice to meet you, PHP!

I have got a few messages on my LinkedIn regarding my PHP post the other day so I decided to write a bit about the start of my journey in the world of PHP.

My main motivation for learning this language is -and I'm going to be brutally honest- the job market. Studying Ruby on Rails at Flatiron Bootcamp was amazing, but the job prospects are grim as most of the Rails jobs are for people with a few years of experience, not juniors, but I derail (pun intended).

Okay so as a PHP junior, I've found a few useful resources and tools:

XAMPP

XAMPP is a popular PHP development environment that you can install on all the platforms (Linux, Windows and Mac). If you follow the instructions from here -- click on the video, you should have it up and running in no time.

You just open up the XAMPP after you installed it and click on the start buttons for the Apache and MySQL modules.

xampp interface

This will basically start your server which you'll find by default under the "localhost" address, so just type that in your browser.

You'll want to create your own php files, right? So in order to do that, go to the path 'xampp/htdocs' and create a folder with your project, maybe something cool like "todolist". Todo lists are cool, right? ...right?

Right!

Create your php files there and you can access them from your localhost address like this "localhost/todolist/index.php".

Simple, right?

Now you just need to know how to write PHP and you're sorted.

I highly recommend this FREE course by Brad Traversy.

Creating a database from 'localhost/phpmyadmin'

It's quite simple to create a database using XAMPP.

Type in your browser search bar 'localhost/phpmyadmin' and you'll see an overwhelming interface, but do not worry! It's not that scary if you actually look at it.

localhost php my admin interface

On the right side you can see the magic word "New". You can either press it, or be directed by default to the database panel where you have to enter the database name and just press create.

new database tab

For this example I've created a table named "posts" that has 4 columns.

The first column is the "id" which you need to make sure it has a type of "INT" (integer) and that it is automatically incremented, by checking the "A_I" checkbox.

The second one is designated for the body of the post (the actual content) with a type of "TEXT" -- no need to give it other attributes.

The third one, author is going to be a type of "VARCHAR" with a length of 255 characters

And the fourth will have a "DATETIME" type that we will give a default value of "CURRENT_TIME".

Press Save and you'll have a lovely table like this:

database table view

Of course, you can play around and go to the INSERT tab and populate your database, but going more in depth is out of this article's scope.

Postman

This is an amazing tool for testing your API -- if you want to build any. But you should want to build at least an API in your lifetime. It's fun and it's not that hard!

PHP API course - this one has Postman included and Postman course - this one is focused on Postman

VSCode

Use VSCode.

💖 💪 🙅 🚩
swishyfishie2
Swishyfishie

Posted on December 5, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Nice to meet you, PHP!
php Nice to meet you, PHP!

December 5, 2020