Archive for September, 2009

Enable Apache mod_rewrite on Windows

In httpd.conf file the following line should be uncommented :
LoadModule rewrite_module modules/mod_rewrite.so
by removing the # sign before it.
Then comes a section which looks like this :
<Directory "C:/Apache2.2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
[...]

List foreign keys in mysql

One interesting way of listing foreign keys is like this :

select
concat(table_name, ‘.’, column_name) as ‘foreign key’,
concat(referenced_table_name, ‘.’, referenced_column_name) as ‘references’
from
information_schema.key_column_usage
where
referenced_table_name is not null;