Posts Tagged dev

MySQL makes stuff easy 2

Jul 6th, 2009 Posted in MySQL | no comment »

How to convert old html-symbols to utf-8 automatically in MySQL?

i did it with REPLACE():

UPDATE `articles` SET `title` = replace(`title`,'ä','ä');
UPDATE `articles` SET `title` = replace(`title`,'ö','ö');
UPDATE `articles` SET `title` = replace(`title`,'ü','ü');

… worked with all my old tables :)

PHP SQLite3 support

Jul 4th, 2009 Posted in PHP, SQL | no comment »

I never before noticed the SQLite3 class in PHP. Until now.

OK … so what can you use sqlite for? Let’s assume you are developing a database driven app. Wouldn’t it be nice to not have to set up a mysql server on your laptop to be able to code on localhost whereever you are?

With SQLite you only need one *.db file and your ready to run!

$database = new SQLite3('test.db');

That’s all it takes to make a new SQLite object in PHP.

The SQLite code is actually verry similar to MySQLi object code. I like it. Hopefully you do to ;)