mysql_result(mysql_query(
Oy! I hope you meant that for demo purposes, and just accidentally left off the "error checking omitted" disclaimer. The problem with doing it this way is that if something does go wrong then you get a cascade of error messages about invalid result index, etc.
I know it's boring and tedious, but there isn't a good substitute for checking valid results one by one:
if (!($result = mysql_query(...)))
{
// your own user-friendly error handling here
}
else