Category Archives: Database

SQL Server – Select Nth Row

Seems like I’m now stuck with .NET development and the current tasks where developing SQL scripts. One of the spec was to return the first record, second record and third record as columns for a row. I know how to … Continue reading

Posted in SQL, SQL Server | Tagged , , , , , , , , | Leave a comment

SQL Server – Dynamic Where Clause

Things can be neatly done in application level by concatenating where clause however, there are times when you are out of that application and all you can do is SQL Query. I have found a good resource to do so … Continue reading

Posted in Database, SQL | Tagged , , , , | Leave a comment

PHP and PostgreSQL on Windows

PostgreSQL is now easy to install on Windows using its installer. However, integrating it with PHP in Windows usually has problems. No matter how you configure PHP and the DLL for postgres extension, it will not work out of the … Continue reading

Posted in PostgreSQL | Tagged , , , , , , , | 3 Comments

Changing URL – WordPress and Moving to a new domain

If you have a blog that is up for few years already and suddenly you decided to move to a new domain / url, you end up changing all the link from config, to post contents and to comments. Using … Continue reading

Posted in MySQL, WordPress | Tagged , , , , , , | Leave a comment

Updating Multiple Rows in MySQL

There comes a time when you need to update multiple rows with different values. You can update multiple rows with the same value, but when dealing with different values for different rows, it becomes a difficult task. Yes there are … Continue reading

Posted in Database, MySQL, SQL | Tagged , , , , , , , | Leave a comment

Making MySQL 5.1 Dump Compatible with MySQL 5.0

While posting this, the process of restoring a MySQL dump is still running. When all you have is a MySQL 5.1 dump and you need to restore it to a server running MySQL 5.0, you’re out of luck, because MySQL … Continue reading

Posted in Database, MySQL | Tagged , , , , , , | 2 Comments

MySQL Backup Strategy

The Story A few months ago, while at home, my supervisor called me. The incident was that our client’s QR System stops working on a certain module. I learn that the possible cause was a table corruption, so the the … Continue reading

Posted in Database, MySQL | Tagged , , , , , , , | Leave a comment

MySQL Query – No Quote For String Fields

One of the module in our project, it is experiencing a slow performance. The module will let the user scan the PCB barcode of an item and updated a record on the database. It was originally built on MyISAM table … Continue reading

Posted in Database | Tagged , , , , , , | Leave a comment

Zend Framework – Zend_Db In Clause

I really thought it was hard to implement the IN clause in Zend Db Select, but after a few research, it was very easy just like the other clause in the WHERE clause. All you need is an array then … Continue reading

Posted in SQL, Zend Framework | Tagged , , , , | 4 Comments

MySQLDump In Many Many Ways

Again, there is another need to blog this thing. I encountered this situations where dumping the database using default options does not fit the purpose, so today, we will be playing with mysqldump options for making MySQL backup. Simple Backup … Continue reading

Posted in MySQL | Tagged , | 2 Comments