Mysql Help
#1

PHP код:
mysql_format(MySQLCon, szQuery, sizeof(szQuery), "select Faction, count(*) from players GROUP BY Faction"); 
This mysql code is working but its not giving me the result which i need ?
it shows like this
PHP код:
+---+------+----+
| 
Faction | COUNT(*) |
+---+------+----+
| 
2      |        1 |
| 
3      |        2 |
+---+------+----+ 
this code does'nt show the empty factions like 0 1 4 5 6
i want a mysql code to give me result like this
PHP код:
+---+------+----+
| 
Faction | COUNT(*) |
+---+------+----+
| 
0      |        0 |
| 
1      |        0 |
| 
2      |        1 |
| 
3      |        2 |
| 
4      |        0 |
| 
5      |        0 |
| 
6      |        0 |
+---+------+----+ 
please help me
Reply
#2

Do you have the factions defined elsewhere in your database? Else it won't be possible.
Reply
#3

yes i have
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Do you have the factions defined elsewhere in your database? Else it won't be possible.
help me please fast
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)