Category: PHP Tutorial

python tutorials and learn python

Created with Sketch.

PDO Querying Data

PDO Querying Data Summary: in this tutorial, you will learn to query data from a table using PHP PDO using the query() method of the PDO object and a prepared statement. To select data from a table using PDO, you can use: The query() method of a PDO object. Or a prepared statement. When a…
Read more

PHP PDO Update

PHP PDO Update Summary: in this tutorial, you will learn how to update data in a table using PHP PDO. Updating data from PHP using PDO To update data in a table from PHP using PDO, you follow these steps: First, connect to the database by creating a new instance of the PDO class. Next,…
Read more

Inserting Data into Tables from PDO

Inserting Data into Tables from PDO Summary: in this tutorial, you will learn how to insert one or more rows into a table using PHP PDO. The steps for inserting a row into a table To insert a row into a table, you follow these steps: First, connect to the database by creating a new…
Read more

PDO IN

PDO IN Summary: in this tutorial, you’ll learn how to use PDO to execute a query with the IN operator. A quick introduction to the IN operator The IN operator returns true if a value is in a set of values. The IN operator can be used in the WHERE clause of the SELECT, UPDATE…
Read more

PDO LIKE

PDO LIKE Summary: in this tutorial, you’ll learn how to use PDO to execute a query with the LIKE operator. Introduction to the SQL LIKE operator The LIKE operator returns true if a character string matches a specified pattern. Typically, a pattern includes wildcard characters like: % matches any string of zero or more character…
Read more

Inserting Data into Tables from PDO

Inserting Data into Tables from PDO Summary: in this tutorial, you will learn how to insert one or more rows into a table using PHP PDO. The steps for inserting a row into a table To insert a row into a table, you follow these steps: First, connect to the database by creating a new…
Read more

Creating New Tables

Creating New Tables Summary: in this tutorial, you wil learn how to create new tables in the database using PDO. SQL statements for creating new tables To create a new table in a database, you use the CREATE TABLE statement. For example, the following CREATE TABLE statement creates the authors table: CREATE TABLE authors( author_id…
Read more

PHP PDO MySQL

PHP PDO MySQL Summary: in this tutorial, you will learn how to create a new sample database in MySQL for practicing with PDO. Creating a database First, log in to the MySQL database using the root user from the Command Prompt on Windows or Terminal on macOS and Linux: mysql -u root Code language: Shell…
Read more

Connecting to PostgreSQL

Connecting to PostgreSQL Summary: in this tutorial, you will learn how to connect to a PostgreSQL database server using PHP PDO. Prerequisites To make a connection to the PostgreSQL database server using PHP PDO, you need to have: A PostgreSQL database server, a database, and an account with a username and password that can access…
Read more

Connecting to MySQL

Connecting to MySQL Summary: in this tutorial, you’ll learn step by step how to connect to a MySQL database from PHP using PDO. Prerequisites Before connecting to a MySQL database server, you need to have: A MySQL database server, a database, and an account that has access to the database. PDO MySQL driver enabled in…
Read more