My Blog

All about my activities, Ideas and everything.

Month: July, 2008

PHP5 and MySQL5 With Thai Encoding

Use this code to enable thai support 12345678910111213141516$dbhost = ‘localhost’; $dbuser = ‘user’; $dbpass = ‘pass’; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (’Error connecting to mysql’); $dbname = ‘webboard’; mysql_select_db($dbname); mysql_query("SET character_set_results=tis620"); mysql_query("SET character_set_client=’tis620′"); mysql_query("SET character_set_connection=’tis620′"); mysql_query("collation_connection = tis620_thai_ci"); mysql_query("collation_database = tis620_thai_ci"); mysql_query("collation_server = tis620_thai_ci");

Javascript : A very simple modal form with a return value

To build a modal form web page. You can use this java script. JAVASCRIPT window.showModalDialog(‘popup.html’) And set the return value by doing this JAVASCRIPT function doOk() {   window.returnValue = ‘hello’;   window.close(); }

JBoss : Datasource

Just create a new xml file with *-ds.xml pattern. And paste inside the deploy folder http://wiki.jboss.org/wiki/ConfigDataSources