CategoryEssentials

PHP tutorials for beginners.

Create MySQL Database in PHP

C

In the previous tutorial, we learned to establish a connection between PHP and MySQL using MySQLi and PDO. After making the connection, the very next step is to create a database. In this article, you will learn how to create a MySQL database in PHP. Create New Database using MySQLi (object-oriented) PHP provides CREATE DATABASE statement to the new database. In the following example, we will...

Connect to MySQL – PHP

C

Moving a step ahead towards MySQL with PHP, we will learn how to connect to MySQL database in PHP. Connect with MySQL in PHP There are two methods in PHP to make the connection with MySQL. MySQLi extensionPHP Data Objects (PDO) MySQLi is an improved version of MySQL which was used in the earlier versions of PHP. Which is better MySQLi or PDO? The answer depends on the scenario. Both of these...

PHP with MySQL Database

P

There are many databases that PHP supports but the MySQL database is the most popular among them. After going through the PHP Basics, Form Handling, Advanced topics, and then OOP, we are ready to start new Database series of PHP tutorials. MySQL database in PHP In this Database series, we will learn to connect, communicate and perform database operations. Hopefully, you will enjoy these things...

Iterables in PHP

I

What is an Iterable in PHP? Recall the loops tutorial in this PHP series and get to the foreach loop to be exact. In this article, you will learn iterables in PHP in link with foreach loop. Iterables is any value that foreach loop accept and is iterable.PHP 7.1 introduced this pseudo-data type and it can be used as return data type of functions. Also, function can accept iterables as its argument...

PHP Arrays

P

Introduction Arrays are consecutive blocks of memory locations to store data in them. PHP provides one-dimensional as well as multi-dimensional arrays, that can be in key-value form. In this article, you will learn about PHP arrays in depth. To build a strong base in PHP, it’s very important to have a clear concept of PHP arrays. So, let’s dig into it. What happens when data is stored...

PHP Functions

P

Functions increase both the readability and reusability of the code. Without using the function, a lot of repetition of code occurs. In this PHP tutorial, you will learn the PHP Functions in detail. What is PHP Function and How to declare a function in PHP? PHP functions are its real power. There are two categories of functions in PHP. Built-in Functions: PHP provides more than 1000 built-in...

PHP Conditional Statements

P

Introduction PHP 8 contains three types of major conditional statements, If…Else…ElseIf conditional statements. In this article, you will learn the PHP conditional statements starting from the basics to their advanced usage. What are PHP Conditional Statements? PHP Conditional Statements specify a condition to run the code block of the conditional. When the conditional statement...

PHP Loops

P

In this article, you will learn about PHP loops and the changes made to the loops in PHP 8. So, first of all, learn the definition of loop. What is a loop? A loop is an iteration of code that can be infinite or finite. A loop may consist of a starting point and an ending condition. In PHP we have 4 types of major loops. After this section, you will learn them in the sequence in this PHP 8...

PHP Numbers and Math functions

P

Introduction You will learn PHP numbers and useful math functions available in PHP 8. We will see the Number strings, Floating Numbers, and Integers first. In the next section, we’ll explore useful math functions that a PHP developers may need in their daily routine. Integers in PHP What are integers? Integers are numbers that can be either positive or negative without a decimal point. The...

Introduction to PHP Operators

I

Introduction to PHP Operators Operators are used for performing some operation between the variables or values. Almost all languages provide various operators to apply to mathematical values, strings, arrays, etc. Similarly, PHP 8 is loaded with useful operators. In this article, you will learn the following operators available in PHP 8. Operators in PHP Arithmetic operatorsAssignment...

Tutor Network