我想創建一些代碼來做一個在MySQL組件的列表。
像這樣如何創建從PHP選擇
decod - 1,2,3,4,5
,並使其在下拉listlike這
decod (dorplist) 1
2
3
4
5
我這個嘗試之一:
<?php
$mysqli = mysqli_connect("host", "username", "password", "name");
$result = mysqli_query($mysqli, 'SELECT * FROM componnets') or die(mysqli_error(mysqli));
while ($row = mysqli_fetch_array($result)) {
$org = str_replace("," , "'>", $row['fill']."");
$replace = str_replace("," , "
".$org."</option><option value='", $row['fill']."'>");
echo "<input type='hidden' name='compo' value='".$row['compon']."'>".$row['compon']."";
echo "<select name='fill'>";
echo "<option value='".$replace."'>".$replace."</option>";
echo "</select>";
}
// Free result set
mysqli_free_result($result);
/* close connection */
$mysqli->close();
?>
,做使它輸出到XML
但我不知道如何!這樣
<input type='hidden' name='compo' value='DECODERS'>DECODERS
<select name='fill'>
<option value='1010'>20'>30'>40</option>
<option value='2010'>20'>30'>40</option>
<option value='3010'>20'>30'>40</option>
<option value='40'>'>1010'>20'>30'>40</option>
<option value='2010'>20'>30'>40</option>
<option value='3010'>20'>30'>40</option><option value='40'></option>
</select>
<input type='hidden' name='compo' value='DECODERS'>DECODERS
<select name='fill'>
<option value='10'>10</option>
</select>
這不是你的數據庫用戶名和密碼,它是:
像這樣的東西可能讓你在正確的方向開始了嗎?你是認真的嗎? – Skayo
@Skayo我只是假設'主機'不能解析爲公共IP:P –
當然,但你只需要獲得主機(這比獲取密碼和用戶名更容易),然後你就可以進入。 – Skayo