We have seen file upload using PHP in previous tutorials PHP file upload but in this tutorial we will see how to save files to MySQL database using PHP.
You may be wonder why you would need to save file content into database rather than just into the file system. In situations where PHP application needs to put entire file then the preferred method would be to put the file into server’s file system and save the file path into the database.
However in situations, where an application needs to save the entire file content into database along with other data. In such cases you have to put the file content into MySQL’s BLOB data type field.
Continue reading “Save Files to MySQL using PHP”
In the world of web it is important to take backup of our site and database frequently. We do not know when we would come across unexpected error which causes our site stop working. Here I will show you in PHP application which will help you to take backup as per your wish whenever you want to take backup. While most web hosting company do a daily backup of a customer’s database and site, relying on them to make backups and provide them at no cost is risky also.
Never take chances when your website is on the line. Make frequent backups !
If you have any query please feel free to send a query. Continue reading “Database backup using PHP”
This tutorial will show you how to login to an application with remember me functionality. Sometimes we need to remember username and password for few days or years so that next time onwards a user can login without entering the username and password into the input fields. The username and password fields get populated automatically from the cookie where the username and password are kept for few days or years. Continue reading “PHP MySQL Login Logout with Remember Me”
Sometimes we need to check username availability instantly before a user presses the submit button after filling a long-sized signup form. In this case we can use AJAX with any technologies like PHP, Codeigniter, Servlet, Struts, JSF, Spring etc. for checking whether the input username is avaialable or already occupied by someone else. So if we give instant result to the user for username availability then sometimes it makes more sensible than while pressing the submit button and goes top of the signup form to rectify the username input field if input username is not available.
This tutorial shows how to check username availability using PHP, AJAX and MySQL. So after finishing this example you will be able to apply the same logic to any PHP framework or any server side technologies. Continue reading “Username availability check using PHP, AJAX and MySQL”
I wanted to build the infinite level of categories and subcategories on the fly from a MySQL database. So I am going to give an example on infinite multi level nested category with php and mysql.
You may read also Infinite dynamic Multi-level nested category with Codeigniter and MySQL
Continue reading “Infinite dynamic Multi-level nested category with PHP and MySQL”
This tutorial shows an example with commonly used functions on how to connect to MySQL database using PHP. I have used here mysqli_* function to connect the database. I have also written here some most commonly used functions to reduce the efforts. Continue reading “Database connection example in PHP and MySQL”