run count db from php, intermediate