Ah, Viggie_swe, you're too quick!
That code will work very well, but whenever you see "or die(mysql_error())" make sure you either remove it completely or use some other error message so that sensitive information is not given away to normal users when your site is in production.
A simple or...