0
我有一個生成的下拉<select>
<option>
小號while循環打印空白<option></option>
<select>
<option></option>
<option name="the-correct-display">The Correct Display</option>
<option></option>
<option name="the-correct-display">The Correct Display</option>
<option></option>
</select>
任何爲什麼我得到的空白思想內容的功能?這裏的功能:
function catalogGetColors($mysqli)
{
$query = 'SELECT sectionName FROM sections';
if($result = $mysqli->query($query)){
while($row = $result->fetch_array(MYSQLI_BOTH)){
$optName = strstr(strtolower(str_replace(' ', '-', $row['pName'])), '-', true);
printf('<option name="%s">%s<option>', $optName, $row['pName']);
}
} else {
printf('Something went wrong.');
}
}
這是在內部使用的,所以我不擔心準備的語句或PDO(還)的原型版本。