Everyone,
Can someone see why this select box doesnt display the numbers, but only the default text?
<?php
include_once "connect_to_mysql.php";
//Placing the page under the relevant subject, using a dropdown list
$sqlCommand = "SELECT subjectid FROM pages ORDER BY subjectid ASC";
$query = mysqli_query($myConnection, $sqlCommand) or die (mysql_error());
while ($row = mysqli_fetch_array($query)) {
$subjectid = $row['subjectid'];
}
?>
<p><b>Place Your Page for subject: <span class="required">*</span></b></p>
<i>This is the position of your link!</i><br />
<select class="boxstyles" name="subjectposition">
<?php
echo "<option>Choose A Subject For Your Page </option>";?>
<?php
$result = mysqli_query($myConnection, $query);
$subject_count = mysqli_num_rows($result);
// Subject_count +1 b/c adding a subject
for($count=1; $count < $subject_count+1; $count++) {
echo "<option value=\"{$count}\">{$count} </option>";
}
?>
</select>
I am using this to place a page under whatever subject the user decides, and using the subjectid for this.
So the select box should display display the relevant numbers, but I only get the default text: "Choose A Subject For Your Page"?
But nothing gets counted in the way I have made this?
Klemme