Tag Archives: coding

How to make multiple updates using a single query in MySQL

As you might know it’s quite easy to make multiple INSERTs in a single query, like this:

INSERT INTO mytable
(id, title)
VALUES
('1', 'Lord of the Rings'),
('2', 'Harry Potter');

However, for some strange reason you can’t do multiple changes to a table in a single UPDATE query like this:

UPDATE mytable
SET (title='Great Expectations' WHERE id='1'),
(title='War and Peace' WHERE id='2');

Continue reading How to make multiple updates using a single query in MySQL

How to crash IE6 with one line

Hamachiya2 found out a way to crash Internet Explorer 6 (and on some systems even the entire operating system).

<style>*{position:relative}</style><table><input></table>

A simple line (which you can test it here) – no one figured out why caused an exception in mshtml.dll (and knowing Microsoft we’re most likely never going to find out the answer to that).

Internet Explorer 6 crash

The code doesn’t have any problems on Firefox, IE7 or other browsers. Well, I hope you’re not still using IE6 – although according to these browser statistics 37.3% were still using it in June 2007.