Posts

Showing posts from July, 2012

Script - How To Convert Table to UTF8_bin

1. Copy and paste this script. Save to ConvertToUTF8.php.  2. Change database info to appropriate, dbuser to database user, dbpass to database password and dbname to database name. &lt? php // Database info $dbhost = "localhost"; $dbuser = "root"; $dbpass = ""; $dbname = "smachdb"; //————— header("Content-type: text/plain"); $dbconn = mysql_connect($dbhost, $dbuser, $dbpass) or die( mysql_error() ); $db = mysql_select_db($dbname) or die( mysql_error() ); $sql = "SHOW TABLES"; $result = mysql_query($sql) or die( mysql_error() ); while ( $row = mysql_fetch_row($result) ) { $table = mysql_real_escape_string($row[0]); $sql = "ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_bin"; mysql_query($sql) or die( mysql_error() ); print "$table changed to UTF-8.\n"; } mysql_close($dbconn); ?> cikguphablog

Moodle - Fail-fail penting untuk backup

Image
1. database 2. Moodledata 3. program moodle

SCROLL BOX w/ Background Color

HTML CODE: You can also adjust height and width  ENJOY! Change also the background color background-color:#B4CDCD;" Change it with hex color you like. <div style="height:150px;width:550px;overflow:scroll;background-color:# B4CDCD ;"> YOUR TEXT CONTENTS HERE! YOUR  TEXT CONTENTS HERE! YOUR  TEXT CONTENTS HERE! YOUR  TEXT CONTENTS HERE! YOUR  TEXT CONTENTS HERE! </div> <p style="font-size:10px;"><a href="http://cikgupha.blogspot.com/">cikguphablog</a></p> just copy and paste the html code to your html box/blog/website. EXAMPLE/RESULT: cikgupha.blogspot.com! ...................................... Mari belajar matematik!........................................... Cara mudah dan senang! ................................................ Ada latihan! ............................................................. Ada video tutorial! ......................................................... ...

Skrip Menukar Password - Moodle

Ada 2 masalah besar apabila upgrade database, iaitu tidak dapat logon dan perubahan format database (utf-8 bin). 1. Skrip ini digunakan untuk menukar password. Password yang ditukar adalah sama dengan nama pengguna (username). 2. Skrip ini hendaklah disimpan dengan nama tukarpass.php. 3. Simpan dalam folder program moodle. 4. Anda perlu ubah 3 perkara iaitu nama database, username dan password. Sila rujuk fail config.php sekiranya anda tidak faham. 5. Inilah skripnya. <?php // please increase max execution time to 300, example max_execution_time = 300 //mysql_connect("localhost","db_user","db_password"); mysql_connect("localhost","root","root"); //mysql_select_db("db_name"); $dbname=mysql_select_db("lmssmach"); // convert database to format utf8_bin // ALTER DATABASE `database-name` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin echo "------------convert database to format utf8-bin ----...

MYSQL - Got a packet bigger than 'max_allowed_packet' bytes

It works when I add behind line into this file Address: Server localhost/ /etc / my.cnf max_allowed_packet = 128M and restart service mysql