how to count records from two tables in mysql query
SELECT sum( dummyTable.tot )
FROM (
SELECT COUNT( * ) AS tot
FROM agenda
WHERE id_users = ’1315907789′
UNION
SELECT COUNT( * ) AS tot
FROM agenda_share
WHERE id_friends_user = ’1315907789′
) AS dummyTable
Share on Facebook