hi infolock;
Answered in point form (hopefully I can assit you in easing your growing irritation to my post which seems to be currently, quite tremendous)
1) $field_name2 is not always set to status that was my mistake
2) i do understand his question
3) check my code to see my first if statement there are quite a few and have nothing to do witrh the result I am trying to meticulously obtain
4) I am echoing my varibles as follows, if this is incorrect please be a sweetheart and do tell:
Code: Select all
echo $totalRows_Recordset2 . $row_Recordset1['MaxSeats'];
This is the way that section of my code worksand I must apologize for saying that It also equals status bcos that was incorrect. It only says status sometimes, by that I mean when the mysql_fields function runs through my table and picks up a column called 'status' it will execute the if statement within that 'status if statement'
Code: Select all
($field_name2 == "e;Status"e;)
.
What it should then dois find out if the maximum amount of people have been reached
Code: Select all
($totalRows_Recordset2 <= $row_Recordset1ї'MaxSeats'])
if not it should then just assign the 'Wait' string to the attend variable.
The following is the complete code for that piece of codeI am running:
Code: Select all
for($y=0; $y < $dbfield_num2; $y++) {
$field_name2 = mysql_field_name($dbfields2, $y);
if ($field_name2 == "ID") {
echo "";
}
elseif ($field_name2 == "Title") {//if we find this field give user the following dropdown with these options
echo("<tr><td><strong>Title :</strong></td><td><select name='field[]' id='field[]'>
<option value='' selected>Title</option>
<option value='Mr.'>Mr.</option>
<option value='Mrs.'>Mrs.</option>
<option value='Ms.'>Ms.</option>
<option value='Dr.'>Dr.</option>
<option value='Prof.'>Prof.</option>
</select></tr>");
}
elseif ($field_name2 == "Transport") {//if we find this field give user the following dropdown with these options
echo("<tr><td><strong>Transport :</strong></td><td><select name='field[]' id='field[]'>
<option value='' selected>Select</option>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select></tr>");
}
elseif ($field_name2 == "Meal") {//if we find this field give user the following dropdown with these options
echo("<tr><td><strong>Meal Preference :</strong></td><td><select name='field[]' id='field[]'>
<option value='' selected>Type</option>
<option value='Vegeterian'>Vegeterian</option>
<option value='Kosher'>Kosher</option>
<option value='Halaal'>Halaal</option>
</select></tr>");
}
elseif ($field_name2 == "Accom") {//if we find this field give user the following dropdown with these options
echo("<tr><td><strong>Accomodation :</strong></td><td><select name='field[]' id='field[]'>
<option value='' selected>Select</option>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select></tr>");
}
elseif ($field_name2 == "Shirt") {//if we find this field give user the following dropdown with these options
echo("<tr><td><strong>Shirt Size :</strong></td><td><select name='field[]' id='field[]'>
<option value='' selected>Size</option>
<option value='S'>S</option>
<option value='M'>M</option>
<option value='L'>L</option>
<option value='XL'>XL</option>
<option value='XXL'>XXL</option>
</select></tr>");
}
elseif ($field_name2 == "Status") //if we find this field give user the following dropdown with these options
if ($totalRows_Recordset2 <= $row_Recordset1['MaxSeats']) {
echo("<tr><td><strong>Attend :</strong></td><td> <select name='Attend'>
<option selected>Choose...</option>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select></tr>");
}
else { //dont allow user to see dropdown atend code
$Attend = "Wait";
}
else
{
echo("<tr><td><strong>$field_name2 :</strong></td><td><input type='text' name='field[]' id='field[]' value=''></td></tr>");
}
}