Deleting Records with PDO - Coding Cyber

Deleting Records with PDO

1. Deleting Records with PDO

Here in this step, you will learn about delete query. Delete query is also same as select SQL query. Instead of the select query, you can use the delete SQL query.

With exec method, you will get no of affected rows.

After executing the above code, you will get the number of deleted rows.

Other Articles in Learn PHP PDO

2. When to use Query & Execute Method

The difference between query and execute method is query method can be used for select queries. And for non-select queries that is insert, update and delete to get the number of affected rows you can use execute method.

Vivek Vengala

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.