Ok, i'm almost sure that this is going to be simple... I've been coding with PHP and MySQL on and off for a long while now. The last 6 months, I haven't really done much of any coding period... Which is why i'm about to ask you the following question lol:
I'm building a backend for a CMS - no no ... not a content management system, a Clan management System - for a game that i've been frequenting (lately).
I have a database with one table in it.. the tables title is 'memberlist'
Within said table, I have 4 Rows. id(primary key), name, class and leadership status.
In the game, there are 23 different types of classes of characters. What I want to do, is look at the members and determine which characters are of which class and display how many of each class exist within one clan.
<?php
$action=$_GET['action'];
if(!$action) {
$action = "default";
// default displays all members, their class and leadership status.
}
$classQuery = "SELECT * FROM memberlist WHERE class = '$action' ORDER BY name";
// I have links showing on all the members' classes, with $action being whatever their class is. If they are a slayer, the links is like this: ?action=Slayer.
$classResult = @mysql_query($classQuery);
$classCount = @mysql_num_rows($classResult);
// Looping through the classes
while($r=mysql_fetch_array($classResult))
{
/* This bit sets our data from each row as variables, to make it easier to display */
$name=$r['name'];
$class=$r['class'];
$leader=$r['leader'];
echo "\n<br /> $classCount $classs<br />\n"; // Trying to display how many of each classes there are e.g. 30 Slayers
}
?>
That's obviously not all the code I have for this lil project, but I think it's enough to show what it is i'm trying to do. When the above code is run, I get a blank page and i'm a little confused as to why.
You can look at what I have done here: http://www.deadlysin3.net/sadistic/memberList/clanStats2.php
If anyone out there can help me with this ( fairly simple ) problem, I would greatly appreciate it.
Thanks!
😃