I have a column called "series" with a standardized set of names (about 12). And I want to go to the query and get the number of items in that series, but I wanna do it without doing a query for every single series. So I have this setup:
mysql_select_db($database_con, $con);
$query_AdditionalSeries = "SELECT series, quantity AS COUNT(id) FROM table GROUP BY SERIES";
$AdditionalSeries = mysql_query($query_AdditionalSeries, $con) or die(mysql_error());
$row_AdditionalSeries = mysql_fetch_assoc($AdditionalSeries);
$totalRows_AdditionalSeries = mysql_num_rows($AdditionalSeries);
This is going to bring back about 12 results and what I want to do is display the series with the number of items inside of it.
echo $row_AdditionalSeries['series'] .' ['.$row_AdditionalSeries['quantity'].' items inside]';
The above statement would work, but I have a specific order in the layout of my page and the return order of the query won't match the way I want the series to come up. So what I need to do is something like:
$particular_series = // associate row where 'series' == 'versionXpartYnumZ'
echo $particular_series['series'] .' ['.$row_AdditionalSeries['quantity'].' items inside]';
I hope that makes sense - basically, I want to be able to re-associate a new array with a single specific line in my query and that is going to be determined by the column called 'series' - thoughts? Ideas?
Thanks in advance!