PHP autoloading classes example with namespaces
A post on why and how to do file autoloading and namespaces in PHP 7.4 plus. Autoloading files cleans up the code, you no longer have to spam a potential…
PHP backend web language
A post on why and how to do file autoloading and namespaces in PHP 7.4 plus. Autoloading files cleans up the code, you no longer have to spam a potential…
Looping through all the days in the current month with PHP. This loop will start at the first day of the current month with each loop adding 1 day, the…
Displaying data from MySQL without reloading the page can be done with an on-click event which does an Ajax request that then fills elements with the returned data. This is…
The differences between constants and variables in PHP isn’t enormous but here they are: A constant cannot be changed once set and constants are global so unlike variables they can…
OPcache is said to improve PHP performance by storing scripts in shared memory thus avoiding the need to load scripts on each request. Whilst seemingly basic, its setup and enabling…
The basics for PHP MySQL PDO fetch types, whether it be returning just one row, one column or looping through a full table SELECT call. The common 3 fetch types:…
A PHP function to help reduce the load of duplicate code when producing HTML tables. This works by looping through an array for the thead (columns <–>) and then the…
How to Autofill or auto-complete an HTML input form using JQuery with PHP and MySQL. This method uses LIKE in a MySQL query for the typed in characters and returns…
Converting hours, minutes and seconds (H:i:s) string to just seconds with PHP can be done with an adaptable function that also works for just a minutes and seconds string. The…
Roll back a MySQL transaction with the PDO rollBack() function. All that is needed is beginTransaction. Start a transaction and run a query that modifies a table: $db->beginTransaction(); $update =…