select id, name, id as c_id
from events
where deleted = 0
and (select count(*) from sponsor_levels where event_id = c_id) != 0
order by start_date
Unknown column 'c_id' in 'where clause'
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/rockymq1/public_html/includes/php_scripts/database.php on line 48