Hi Big.Nerd (I like your handle) thanks for your reply.
So I've come a bit further than my first post. I have one column for each shift (gate shift, night shift) and if a user selects the 1st shift for 'gate shift' the value is 1 if the select the 2nd shift, the value is 2. This all goes in the gate shift column. I can now calculate the amount of 1's and the amount of 2's (yay!) by doing this:
mysql_select_db($database_pride_volun, $pride_volun);
$query_rsMarch = "SELECT id_volun, COUNT(*) AS total FROM info_volun WHERE gateshift_volun in(2) group by gateshift_volun";
$rsMarch = mysql_query($query_rsMarch, $pride_volun) or die(mysql_error());
$row_rsMarch= mysql_fetch_array ($rsMarch);
$totalRows_rsMarch = mysql_num_rows($rsMarch);
So I can now echo the total of 2's in gateshift_volun and I can change the 2 to 1 to calculate the total of 1's in gateshift_volun and in both cases I can display the shift if there are available spots:
<?php if ($row_rsMarch['total'] <4) echo 'SHIFT' ?>
However, the problem is that I have like 2 or 3 different shifts for each position (2 for gateshift, 2 for night shift, etc) and there are like 10 positions. Do I have to create 30 different recordsets or calls to the database or is there a way to be more general and get specific in the php? What's the best practice?
I tried taking the 'in(2)' out of the sql and putting this in the PHP and got really excited cause it worked for '1' but then it doesn't work for any other number! (rsVolun is a general connection to the table):
<?php
if (!($row_rsVolun['gateshift_volun']==1) and ($row_rsMarch['total'] <4))
echo '<input type="radio" name="gateshift_volun" id="gateshift_volun" value="1"/>';
else echo '[Sorry, shift full]';
?> Saturday 5:00-9:00pm
<-- That works
<?php
if (!($row_rsVolun['gateshift_volun']==2) and ($row_rsMarch['total'] <4))
echo '<input type="radio" name="gateshift_volun" id="gateshift_volun" value="1"/>';
else echo '[Sorry, shift full]';
?> Saturday 5:00-9:00pm
<--- That does not work
Any idea why? Or if I'm totally going about this the wrong way, any suggestions on how best to do this?
Thanks again! I really appreciate your help!