Web development tutorials.

  • Insert MySQL DB Data With PHP PDO

    Insert MySQL DB Data With PHP PDO

    Prepare records to be inserted to a MySQL database using the PDO PDO prepare() function in PHP, then use the PDOStatement execute() function to perform the query. Requirements: PHP PHP Data Objects PDO Drivers MySQL Functions (PDO_MYSQL) MySQL INSERT Statement How to insert new records to a MySQL database using PDO in PHP. Make sure…

    Read more

  • Update MySQL DB Data With PHP PDO

    Update MySQL DB Data With PHP PDO

    Update MySQL records with the PDO prepare() function, it already has an auto-escaping feature for any given parameter values. Bind the user-input value to the query using one of the following, the named (:name) or the question mark (?) parameter marker. Requirements: PHP PHP Data Objects PDO Drivers MySQL Functions (PDO_MYSQL) MySQL UPDATE Statement How…

    Read more

  • Delete MySQL DB Data With PHP PDO

    Delete MySQL DB Data With PHP PDO

    It’s easy to delete a MySQL record using PDO in PHP, just make sure a PDO connection to the MySQL database has been successfully established, and more importantly, use the PDO prepare() function to auto escape any parameter values. Select from the named (:name) or the question mark (?) parameter marker to bind any given…

    Read more

  • Select MySQL DB Data With PHP PDO

    Select MySQL DB Data With PHP PDO

    One simple way of selecting records from a MySQL database using PHP Data Objects (PDO) is with the use of the function query(). This function executes an SQL statement, which in this example is the SELECT Statement. And will return a result set as a PDOStatement Object. Requirements: PHP PHP Data Objects PDO Drivers MySQL…

    Read more

  • Update MySQL Records Using Replace Function

    Update MySQL Records Using Replace Function

    Update DATABASE records directly using the REPLACE() function in MySQL. No scripting or programming language needed. Can be executed in any MySQL visual database design tool, or make the modification directly from shell. Requirements: MySQL Consider below as the employees TABLE inside a MySQL DATABASE. The objective is to update MySQL data records by replacing…

    Read more

  • Replace A String In MySQL

    Replace A String In MySQL

    Use the MySQL string function REPLACE() to replace occurrences of a specified string. It will return the original string with all occurrences of the search string replaced by the new string. This is how to replace a string in MySQL. Requirements: MySQL The objective is to replace all spaces with a dash from all the…

    Read more