• 724 0

    In the previous tutorial we learned about PDO Extension . In this tutorial we will learn CRUD operation using PDO Extension. CRUD Stands for create, read, update and delete record in the database. [aio_button align="center" animation="none" color="red" size="small" icon="play" text="Live demo " target="_blank" relationship="dofollow"...

  • Delete Records
    1655 0

    1) Write the delete statement: 2) Prepare the query: 3) Bind the parameters: 4) Define the bound values: 5) Execute the query: 6) Check that the query has been performed and that the records have been successfully deleted from the database. All code together now:

  • Update the Date with PDO
    1544 0

    1) Write the regular update statement and again, instead of values, assign the named placeholders. For example: 2) Prepare the query: 3) Bind the parameters: 4) Define the bound values: 5) Execute the query: 6) Check that the query has been performed and that the database has...

  • Read Data in PDO
    1766 0

    Reading data from the database is not so different than inserting data, with steps 1 to 5 being almost identical while the sixth step is different. 1) Write the regular select statement and again, instead of values, put named placeholders. For example: 2) Prepare...

  • Use PDO to Insert Data’
    2120 0

    The SQL code for the users table: 1) Write a regular SQL query but, instead of values, put named placeholders. For example: The use of placeholders is known as prepared statements. We use prepared statements as templates that we can fill later on with actual values. 2)...

  • Use PDO
    3771 1

    PDO (PHP Data Objects) is a PHP extension through which we can access and work with databases. Though PDO is similar in many aspects to mySQLi, it is better to work with for the following reasons:  It is better protected against hackers. It is...