How to Create Breadcrumb Using the Nested Set Data Model in SQL Server

Still remember the similar article I wrote regarding the title of this article? Well, if you want to implement breadcrumb using the SQL Server database, then here is the related Stored Procedures in SQL Server format. In other words, this following article will show you the same Stored Procedures in SQL Server instead of using [...]

Share
[Read more...]

How to Handle Duplicate Records by Deleting and Leaving Only One Record from Each Duplicate Records in MySQL Database

Have you ever got difficulty when handling the duplicate records in a table in MySQL database, where you want to delete the records and pretty leaves one record from each duplicate records? This usually happens in the table who did not have the primary key, so that it can cause to store the duplicate records. [...]

Share
[Read more...]

How to Replace the Certain Character in a MySQL Table

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 [...]

Share
[Read more...]

Displaying Some Comma-Separated Sub-String Values from A Single String to The Checked CheckBoxes Control in PHP

Yesterday I faced a situation while I was trying to get some sub-string values that derived from a single string that being saved in database, and displayed them to the checked CheckBoxes control in PHP. Let’s say I had 5 CheckBoxes control named Applications on my form, whereas the values stored in a single string [...]

Share
[Read more...]

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

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 [...]

Share
[Read more...]

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

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 [...]

Share
[Read more...]

How to Avoid Duplicate Message from Client Saved in osTicket v1.6 RC5

Actually, this modification is similar with another one that I made here: How to Avoid Duplicate Ticket Content in osTicket System. After client post message (reply) to his/her ticket that has been created before, then client reload/refresh that next page, the duplicate message will be saved in database. This modification will avoid that duplicate message [...]

Share
[Read more...]

How to Make Phone Number Started With “0″ Saved in osTicket System v1.6 RC5

Both in osTicket System version 1.6 RC4 and 1.6 RC5 have not saved the “0″ character if the phone number started with the zero character. For example, if the client’s phone number is 08157140595, then this number will be saved in database as 8157140595 (the first “0″ character will not be saved). This happens since [...]

Share
[Read more...]

How to Avoid Duplicate Ticket Content in osTicket System

In osTicket System, when a new ticket created, it executes INSERT INTO SQL, and then displaying the “Thank You” page afterwards. Unfortunately, when client reload or refresh that page, then it will re-execute that SQL again, since the primary key for the ticket table is an ID of the ticket which has the auto-number field. [...]

Share
[Read more...]

How to Convert 10 Digits Numeral to The Date Value?

I have hundreds of records that need to be imported from one table and database (let’s say that this is the first database) to another table in different database (and the last one is the second database). Unfortunately, one of the columns in the table in first database has the Date value in 10 digits [...]

Share
[Read more...]