MySQL dumps are often used as a quick and easy way of backing up an entire MySQL database in one go. However, they are only really designed to restore whole databases as well. So what if you only want to restore certain tables? I have written this nice little PHP script which will take your [...]
Archive: mysql
If you are using windows (with XAMPP) to develop your MySQL applications, you might currently be using phpMyAdmin for your DBA tasks. The phpMyAdmin package is an awesome tool and is a must have, however due to the fact that it runs under Apache and PHP - it can be tricky to use when dealing [...]
This is a nice little function which I struggled to find elsewhere on the web. As discussed elsewhere this is not the kind of thing that should be included in a public facing script, but for administration tools etc its pretty handy: PLAIN TEXT PHP: function add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NULL" ){ [...]
Sometime in MySQL you want to copy an entire table from one database to a separate database. One example of when you would want to do this is if you are making a backup of a table before you apply some kind of processing to that table. There is nothing worse than ruining a database [...]
One of the most common things that needs to be done when tidying up a database is to bulk find and replace data in MySQL tables. This can be for things like spelling mistakes, changing categories of products or any other value held in a MySQL database table. Its an easy thing to do though [...]