$value = mysql_result(mysql_query("SELECT the_field
FROM the_table
WHERE other_field = 'whatever'"), 0);
This works, but I just don’t know if it’s “proper” to do it this way. Is it sloppy coding? If so, is there a better way to get one single value?
I see nothing wrong with this. Additionally, if you want only one row back you can add
LIMIT 1at the end.