Joomla用户信息提交

I am submitting a form for users who are already logged in in the front end, but how can I distinguish between submittions? I want to have a 'user' field in my DB that shows who submitted each entry, but how do I find out which user is logged in and submit that info with the form?

Also, I tried looking for some development tutorials for 1.7, but can't find anything decent, any suggestions are appreciated.

Thanks.

$user = JFactory::getUser();

You would then need to INSERT or SET this name in your database.