If you study them hard enough, MySQL queries are easy and useful... Basicly there are three types:
INSERT (makes a new row)
UPDATE (updates row(s) in a table)
and SELECT (gets data from a table)
If you study these, you will find MySQL queries easier and VERY useful...
As far as I know, there is not a function to do what you would like... you may have to build a custom function or get someone to do tbhat for you.
I can't be bothered to do that at the moment, and I think that you would be better doing it yourself (as it will give you experience with PHP and MySQL), but I'm sure that someone may do that for you...
Hope this helps!