-2
$query=mysql_query("SELECT COUNT(*) as totalvotes FROM votes WHERE option_id IN(SELECT id FROM options WHERE ques_id='$poll_id')");
$query=mysql_query("SELECT options.id, options.value, COUNT(*) as votes FROM votes, options WHERE votes.option_id=options.id AND votes.option_id IN(SELECT id FROM options WHERE ques_id='$poll_id') GROUP BY votes.option_id");
閱讀[docs](http://www.codeigniter.com/userguide3/database/queries.html)? – Tpojka
您應該爲您的問題添加更多詳細信息,例如您正在嘗試做什麼,嘗試過什麼,以及您收到了什麼行爲。 – Goose