Contact iFingers

Finger Tips - a fistful of handy web notes

Tuesday, June 13, 2006

MySQL Random Selection

So, you want to find a random result from your MySQL database? Yeah, me too. I have struggled for ages, using fancy queries. If I was clever I would have used this MySQL statement:

SELECT * FROM mytable WHERE myfield = 'something' ORDER BY RAND() LIMIT 1

Thursday, June 01, 2006

London Calling - Hello Beijing?

China Town in London

I have just completed a page for our Chinese visitors at iChauffeur. Translation to Chinese Simplified was not too difficult, thanks to my friend Zhou, but character encoding got me a little frazzled.

If you are Molly E. Holzschlag then the World Grows Small but for mere mortal web designers, character encoding can be a real bug bear.

GB 2312

I found out that I should encode my document as GB 2312, great, but when I try this in BB Edit, there is no GB 2312, I have to use GB 18030, which is like GB 2312 on steroids apparently, but when I try that, the page is a mess in Safari, and it fails on the validation front, so, for now, I have left it as good old UTF-8. Not ideal, by any stretch of the imagination. Can you show me how to save it as GB 2312 in BB Edit?