Page 22 of 56

PHP MySQL get last row of a table in database

Last updated on February 25th, 2022 at 08:15 amIf you have auto_increment field set for MySQL table then it is very easy to get details of last row in that table. I have also provided complete php code on how to get details of last n rows in a MySQL table. We have provided code […]

How to redirect http to https in Apache

Last updated on November 6th, 2024 at 12:51 pmIf your webserver is running on Apache, after configuring SSL for your website, the subsequent step is to ensure that all visitors are automatically redirected from HTTP to HTTPS. This automatic redirection can be achieved by utilizing the .htaccess file. All you have to do is create […]

How to list files and directories using PHP

Last updated on January 12th, 2023 at 12:57 pmPHP has built in functions that can be used for working with files and folders inside a directory. This script covers these major use cases Let us assume in by document root I have As you can see my script named list.php(explained below) is deployed inside /var/www […]

Putty keep alive session without connection timeout

Last updated on August 27th, 2024 at 09:14 amWhen I connect to my linux / unix server using putty it timeouts after sometime automatically. Basically this happens when I do other task while keeping the putty session idle, during this time it popup an error sometimes stating that the session has timeout. This is very […]

« Older posts Newer posts »