Tuesday, February 24, 2009

Convert mysql output to another data type

Sometimes there's a need to convert a datatype from one to another in the database, for example, if the data is store in utf8 format in the database and you want it output to latin1 datatype, one way to do this is using the convert function that mysql provide. Here a snippy code for that:

"SELECT CONVERT(fieldname USING latin1) as newfield FROM dbtable"

More detail can be found on: MYSQL CONVERT FUNCTION

Tuesday, February 17, 2009

Migrate column from one table to another table

Here is an example on how to migrate column between table:

update fo_tags en, fo_tags_cn cn, fo_tags_cs cs
set
en.name_cn = cn.name, en.name_cs = cs.name,
en.kind_cn = cn.kind, en.kind_cs = cs.kind
where en.id = cn.id and en.id = cs.id

Friday, February 06, 2009

Make png file works with ie 6

To make IE 6 works with PNG transparency, one easy way is using a htc script, for example, attached

img.ispng {
behavior: url("/png.htc");
}

to the css file, then for each png image, add a "ispng" class to it.

The png.htc can be download at png.htc

Monday, February 02, 2009

Fixing IE 6 transparent issue

Here a small utility to help fix IE 6 transparency issue on PNG graphic.
http://labs.unitinteractive.com/unitpngfix.php