page 1 of 2

Javascript variable definitions

The variable scope in javascript can still surprise me. This is a nice one I debugged today: A variable that is not defined by "var" have a global scope. Th


Finding ordered position of a row in MySQL

This is slightly modified from something I found @ http://www.kirupa.com/forum/archive/index.php/t-263260.html Using high-score lists or similar you often ha


Duplicating a mysql database

This is another MySQL trick I keep coming back to. mysqldump -u root --password=pass db1 | mysql -u root --password=pass db2 found @ http://mywheel.net/


Locating potential duplicate before switching collation in MySQL

When you need to switch a fields collation you can check if any existing data will conflict with this change. For example a keyword-field might contain data


Copy files while preserving permissions

The unix cp command makes you the owner of the copied files. You can set flags but this is supposedly a more complete way to keep any attributes.
mkdi


Inserting from a select in MySQL

Quite simple but something I can never seem to remember: INSERT INTO files_users (file_id, user_id) SELECT id, '2' FROM efs.files; found @ http://mysq


Doubble echoes and prints are bad in PHP

Echoing an echo in PHP can create confusing output: will output hello1 since you will be printing the return value (boolean true)


Fixing existing data when switching character set in MySQL

When altering a database, table or field from one character set to another, existing data will probably look garbled since it is expected to be in the new chara


Altering character set and collation of tables in MySQL

Altering the character set and collation of a table is sometimes not enough. You may have to alter the actual fields in the table to get MySQL to comply in some


Selecting with a different collation in MySQL

You can select from a table and set the collation to be used for the search. [code] SELECT * FROM my_table WHERE my_field = 'hallÄ'; SELECT * FROM my_tab



page 1 of 2
1 | 2 Next >>