• Delete Records
    962 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
    942 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...

  • Read Data in PDO
    1068 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....

  • Use PDO to Insert Data’
    1109 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...

  • Use PDO
    1659 0

    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...