Nice to meet you, PHP!
Tags: php, postman, api, beginners
Published: 2020-12-05 18:13:13

---
title: Nice to meet you, PHP!
published: true
description: How I started learning PHP
tags: php, postman, api, beginner
//cover_image: https://direct_url_to_image.jpg

---

I have got a few messages on my [LinkedIn](https://www.linkedin.com/in/claudiu-andrei-pestenariu-95a47b160/) 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](https://www.apachefriends.org/index.html) -- 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](https://i.imgur.com/9wb9wmV.png)


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](https://www.youtube.com/watch?v=oJbfyzaA2QA&list=PLillGF-Rfqbap2IB6ZS4BBBcYPagAjpjn&ab_channel=TraversyMedia) 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](https://i.imgur.com/GcwO5gI.png)

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](https://i.imgur.com/kxsveqL.png)

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](https://i.imgur.com/xKLmZr9.png)

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](https://youtu.be/OEWXbpUMODk) - this one has Postman included and [Postman course](https://www.youtube.com/watch?v=Iq7eh6DhN6M&ab_channel=CleverProgrammer) - this one is focused on Postman

##VSCode 

Use VSCode.