[eluser]Twisted1919[/eluser]
Hi , my question is related to sql more than codeigniter , but because i use codeigniter , and i don't have other forum where to ask , i hope i can get some help here .
So , i have 8 tables into a mysql database , each table is a category that has more records and is like this :
category1
category1_id | category1_member_name | category1_member_votes | category1_other datas |
category2
category2_id | category2_member_name | category2_member_votes | category2_other data |
[...]
[...]
category8
category8_id | category8_member_name | category2_member_votes | category8_other data |
Last few days , i tryed to find a method to select just the categoryX_member_name AND the categoryX_member_votes for all categories(just one sql query) and to do a top based on members votes for all categories .
For example , let's say that my tables wolud be like:
cat_html
cat_html_id | cat_html_member_name | cat_html_member_votes
1 | just_first_username | 10
cat_php
cat_php_id | cat_php_member_name | cat_php_member_votes
1 | just_second_username | 25
2 | just_third_username | 30
cat_xml
cat_xml_id | cat_xml_member_name | cat_xml_member_votes
1 | xml_first_username | 55
2 | xml_second_username | 65
[...]
And at the end , i woult obtain an result as follows :
First Place : xml_second_username -> 65 votes
Second Place: xml_first_username -> 55 votes
Third Place : just_third_username -> 30 votes
And so on , i think you got the ideea ...
Is just a can't figure out how i should do it ...
Please , is very important , help me a bit .
Have a nice day