I attached one file that I know works here:
Upload this one to includes/classes/db/mysql/
This overwrites the core file.
Let me know if you still get the error after this,
With v1.3.9 you don't have to touch the query_factory.php file.
You should use this method instead: http://www.zen-cart.com/forum/showthread.php?t=153582