Thank you! That fixed those error codes from showing up...
One more thing is happening though...
I added this to the code:
$_number_of_records = mysql_num_rows( $res );
That is showing that there are 3 records, as there should be.
Why is it that in my while statement...
if ($_POST["custom0"]) {
$res = mysql_query( "SELECT * FROM {$pre}dept WHERE ( !(options & {$HD_DEPARTMENT_INVISIBLE}) )" ) or die(mysql_error());
$_number_o_recs = mysql_num_rows( $res );
if( $_number_o_recs == 1 ) {
echo "<option value=\"0\">Global</option>\n";
} else {
$res = mysql_query( "SELECT * FROM {$pre}dept WHERE ( !(options & {$HD_DEPARTMENT_INVISIBLE}) ) AND id != '0'" ) or die(mysql_error());
$_number_of_records = mysql_num_rows( $res );
while($row = mysql_fetch_array($res)) {
$_this_id = $row["id"];
if( $_this_id == 2 ) {
//Get Value from Database record....
$_domain_check = $_POST["custom0"];
$res = mysql_query("SELECT addon_choices FROM user_db.orders WHERE domain_name = '$_domain_check'") or die(mysql_error());
$_rs = mysql_fetch_array($res);
$_db_value = $_rs['addon_choices'];
if ($_db_value) {
$each_field = explode("|", $_db_value);
} else {
$each_field = array();
}
if (in_array("5", $each_field)) {
echo "<option value=\"{$row['id']}\" " . (($_POST['department'] == $row['id'] || $_POST['department'] == $row['name']) ? "selected" : "") . ">" . field( $row['name'] ) . "</option>\n";
} else {
echo "<option value=\"5\" " . (($_POST['department'] == 5 || $_POST['department'] == $row['name']) ? "selected" : "") . ">" . field( "Free Hosting Support" ) . "</option>\n";
}
} else {
echo "<option value=\"{$row['id']}\" " . (($_POST['department'] == $row['id'] || $_POST['department'] == $row['name']) ? "selected" : "") . ">" . field( $row['name'] ) . "</option>\n";
}
}
}
}
if ($_POST["custom0"]) {
echo ("
</select> Records: " . $_number_of_records . "
....
There should be 3 departements no matter what. But no matter what I enter, rather there is the one that has the 5 in the array or not, there is always ONLY ONE dept.
Any idea what I did wrong on that?
Thank you,
Richard