I have already listed the PHP script to generate backup of database in one of my earlier post. I am listing here the PHP script to restore database from mysql database file.
Category: PHP/MySQL
All content related to PHP and MySQL
Passing by Reference
I am listing here a simple example to explain ‘passing by reference’ in PHP. I hope it is helpful. For further information kindly visit Passing by Reference
Insert and Retrieve file with MySQL
Some of you might be knowing that there is a functionality in MySQL database for storing files and retrieving the same. This is mainly used when we need to reduce response time for retrieving and using files in our application. I am listing here the method for inserting image file in and retrieving image file […]
Mail in PHP
I am listing here the method for sending mail using PHP code. This will be useful in many ways, for example when you want to sent mail after say a form is submitted. Note: This may work in local , but I am suggesting you to execute on live server.
Extracting String
This is small but very useful script. I have shown example for extracting only ‘src’ value from the ‘img’ tag, but you can modify and use as per your requirement using ‘preg_match_all’ function. Output will be ‘http://www.somesite.com/abc.jpg’
Page Redirect
I have written a script for getting the files list from directory and redirecting the page on selecting option from the select box. So you will get the script for fetching all the files from current directory and redirecting page on selection.
Database Backup
I am listing here the PHP script to generate backup of database. For saving the file with ‘sql’ extension replace the code as specified below at specified line numbers in the above code (Although ‘zip’ file will take less space). You can also set cron jobs for dumping databdase in the cpanel of your site. […]
Get IP Address in PHP
Many times we need the IP Address of the User visiting our website in our Application. I am listing here the method to get the User IP Address, hope it might be useful to many of you.
Assign PHP Array to Javascript Array
I am describing here a very useful method for getting the values of a PHP array in JavaScript. For this we need to assign the PHP array values to a array in JavaScript.
Copy Directory
I am listing here the method to copy full Directories with all sub-directories and files.