Maret 29, 2010
By
Firman
Session functions, including session_start() should come first in an PHP page. It can not be preceded by any other thing, not HTML tags, not even a new line!
Maret 26, 2010
By
Firman
Recently I moved my wordpress blog to a new domain. Many links broke. Styles were not applied. After googling,
I stumbled upon this wisdom.
To update WordPress options with the new blog location, use the following SQL command:
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
Browse through WordPress blog to check if everything is okay. You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.
Maret 18, 2010
By
Firman
I am reading
this tutorial from Philip Greenspun. He uses Oracle. He uses reference constraint. One commenter said that you can do that in MySQL only if you use InnoDB storage engine.
The default storage engine in MySQL is MyISAM. If you want to change it, there are quite a numerous ways to do that.
You can change what storage engine to use for a table.
You can change what storage engine to use for a session.
You can change THE DEFAULT storage engine so that whenever you create a new table, that default will be used.
To do the last, you need to edit the file /etc/mysql/my.cnf (in Ubuntu).
Under the [mysqld] add the following line as shown below!
[mysqld] default-storage_engine = innodb
And then restart the mysql:
sudo /etc/init.d/mysql restart