Ok, thank You so much, that is very helpful. For "retrieve the backpath..." i am using the following select. There is nothing much easier i think ?
$mycategorybackpath = qa_db_read_one_value(qa_db_query_sub("SELECT backpath FROM ^categories WHERE categoryid = '$mycatid' "),true);