Hello, the qa_db_query_sub function exists exactly for this purpose, however you're not quite using it correctly. You need to add placeholders to the query then pass the variables separately. Use # for a number and $ for a string.
So your example should be:
$insertqry = qa_db_query_sub("INSERT INTO test_table (title, price) VALUES ($, #)", $title, $price);
Also if you're using Q2A tables, use ^ to automatically add the correct table prefix, so ^posts becomes qa_posts.