In MySQL database, indexes are used to optimize the database server by reducing the cost for searching data. Take it as an example of index page you see at the end of text books. It contains the page number of important words, so you do not have to check each page of the book to …
Read More “Use indexes to reduce the overhead on MySQL server”
PHP PDO (PHP Data Objects) is basically an abstraction to database access, which means it is not limited to only MySQL or any other database system. If you are building a website in MySQL and suddenly you are required to change the database from MySQL to PostgreSQL, if you are using PDO at backend then …
Read More “PHP PDO prepared statement – CRUD Operation”
We will be craeting a custom error handler in PHP. As it name suggests, we will be displaying PHP errors in our own style. Introduction Error logs means to store a copy of an error that occurred in your website and saving it in a separate file. This helps you to keep track of all …
Read More “Custom error handler – PHP”
Page level cache in PHP means that the most frequent data will be stored in cache. So instead of requesting the same data from database, we will just use the cache to display that data. This will reduce the overhead on database by eliminating number of queries on SQL. Or any other database server you …
Read More “Page level cache PHP”
Lazy load images means loading images on websites asynchronously. Lazy loading is technique that defers loading of non-critical resources at page load time. Instead, these non-critical resources are loaded at the moment of need. Where images are concerned, “non-critical” is often synonymous with “off-screen”. If you’ve used Lighthouse and examined some opportunities for improvement, you …
Read More “Lazy load images – Javascript”
Generate sprite image Sprite is a computer graphics term for a two-dimensional bitmap that is integrated into a larger scene, most often in a 2D video game. Which means that small images are combined into one large image to reduce the number of requests on your server. Sprites helps a lot to reduce the number …
Read More “Use sprites to reduce number of requests on website – Javascript, PHP”
Search is one of the feature which is needed in almost every website. Whether you are working on admin panel or user side, you need to provide a functionality where user can search and get data. So, in this article, we will discuss how you can search a string in all tables and columns of …
Read More “Search in all tables and columns – PHP & MySQL”
Suppose you are working on cPanel on a very big project, now you want to search some string in all folders and in all of their files in cPanel. There are very few cPanel that provide such functionality to search some specific string in all files in your domain. This script will allow you to …
Read More “Recursively search string in all folders in cPanel – PHP”
We will teach you how you can convert your <div> into an image using html2canvas library. Download html2canvas library First, you need to download the library called Html2Canvas and paste in your project folder. You can download it from here. After that, paste the JS file in your project and include it via script tag. Then give a unique ID …
Read More “Save div as image – Html2Canvas”
We will be using PHPSpreadsheet library which provides all the functionality to create and read the Excel sheets in PHP. You can download it via composer, make sure you have downloaded and install the composer in your system. You can download the composer from here. Right now there is no standalone version of this library that …
Read More “Create and read Excel sheets with styles and dynamic data – PHP & MySQL”