Author: wavesdream

PHP script to download file from specific folder

Below is a simple example of a PHP script that allows you to download file from a specific folder. You can link to this PHP file with the file name as a parameter.Create a file named download.php and add the following code: Replace ‘/path/to/your/files/’ with the actual path to the folder where your files are […]

Read More

WordPress reserved terms you should never use

While developing WordPress theme or plugin we use different WordPress keywords or terms, additionally while handling forms fields and custom post types we have to consider what names we can use or not. The restricted names are called reserved terms. WordPress itself reserves few keywords or terms which we can not use in our coding. […]

Read More

Websites to find free high resolution stock-images

We always prefer good, high quality stock-images for our websites, blogs, print designs and may be for some other graphical work. Getting good images always cost a lot. Alternatively there are some websiteswhich offer free images called ‘Public Domain Images’. Public domain images are not covered by intellectual property (Creative Commons license) or copyrights which […]

Read More

Get total of MySQL column and show highest totals

To get the total of a MySQL field and then select the three highest totals from the table, you can use the following PHP script: Make sure to replace ‘your_username’, ‘your_password’, ‘your_database_name’, ‘field_name’, and ‘table_name’ with the actual values for your MySQL configuration and table structure. In this script, the SQL query uses the SUM […]

Read More

How to compare any changed data of HTML table among different rows

In a HTML table compare every column data of every row. if any column data has changed value with respect to previous row then highlight that data. We can achieve this using JavaScript. Here’s a basic example of how you could implement this functionality: This code compares each cell of each row with the corresponding […]

Read More

Print total of a variable inside while loop outside of the loop

To accumulate values from a MySQL query inside a while loop and then calculate the total value outside the loop, you can use a variable to store the total value while iterating through the records. Here’s anexample in PHP: This PHP script fetches records from the database, accumulates the values from a specific column (value_column), […]

Read More

Import CSV data into MySQL using PHP

Here’s a detailed example of how to import data from a CSV file into a MySQL database using PHP. The script processes each row one by one, displays a success message for each successfully inserted row, and stops the process if any error occurs, showing the error message. Prerequisites: Ensure you have a MySQL database […]

Read More