Archive

Archive for the ‘MySQL’ Category

How to Replace the Certain Character in a MySQL Table

August 9th, 2010 Masino Sinaga No comments

Have you ever encountered the strange behavior while you were deleting the certain records from a table in MySQL database using an application you build, which those records cannot be deleted? Well, I have! Today, I encountered this problem. This is so weird, since I have never faced this situation before. Well, after doing some investigations, this problem obviously caused by one of the primary key fields contains the comma (,) character. Why I am sure about this, because when I replace the comma character for one record, then I re-try to delete that record from that application, voila…. that record gets successfully deleted. But the main problem is not stop until that. The next question is: How then can I replace all comma characters from the rest of the other records immediately? Just for your information, there are thousand records that contain the comma character. It is impossible to update all the records one by one, even as a matter of fact, you can create a little program/tool in order to implement it using loop method throught the recordset? Well, here is the quick-solution to overcome it. Read more…

  • Share/Bookmark
Categories: MySQL Tags: , , , , , , ,

How to Change Default Storage Engine When Creating New Table in Wampserver

April 28th, 2010 Masino Sinaga 3 comments

Wampserver is one of the popular PHP-Apache-MySQL server for Windows operating system. If you want to create your own web server, especially in your local computer, then you should use this software. It is a free software. After using this software for a few years, I have just realized that when we create a new table, then the default storage engine is INNODB instead of MYISAM engine type. So here is the trick how you can change this value become the MYISAM engine type. Read more…

  • Share/Bookmark

How to Know The Duplicate Records Based on The Same Value in a Field in MySQL Database

November 28th, 2009 Masino Sinaga No comments

Have you ever wanted to know which record has duplicate content based on the same content in a field in MySQL database? This information will be get after you select the records and display them which one have the same content by groupping them by that field. Well, here is the script how you can do that. Read more…

  • Share/Bookmark

How to Select Distinct And Get the Certain Characters From a Field in MySQL Database

November 27th, 2009 Masino Sinaga No comments

Today I faced an interesting situation while getting the certain characters from a field and wanted to display them by using SELECT DISTINCT statement in MySQL database. Suppose we had thousand records in a table and we wanted to get the certain characters from the first until the certain position counted 6 characters from the right of all particular characters, and display them by using the SELECT DISTINCT statement. So, what would you do? Well, here is the solution I made in MySQL database. Read more…

  • Share/Bookmark