Programming

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…

  • 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…

  • 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…

  • 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…

  • Change The Excerpt Limit In WordPress

    Change The Excerpt Limit In WordPress

    Modify the default (55) maximum number of words in WordPress post excerpt. Set the length according to your needs using the add_filter filter hook. Requirements: WordPress functions.php file Step 1. Open the active theme’s functions.php file and create a function that will return the desired number of words for the post excerpt. In this example,…

  • Create An Image With PHP

    Create An Image With PHP

    With the help of the GD library, it is possible to create a JPG, GIF, PNG, and other image formats (Formats supported by GD) in PHP. Either output the generated image on a browser or to a file. Requirements: PHP ^7.2.0 PHP GD Library The first attempt is to create a JPG image and output…