我正在使用带有 smarty 的 tpl 系统,当我尝试使组合框具有多个选择时,即使查询中有多个值,我也只能选择一个。
概述2.php:
$smarty->assign("MYTEAM", $team->myteam);
$smarty->assign("MYTEAMID", $team->myteamid);
$overview2_tpl = $smarty->fetch("overview2.tpl");
$smarty->assign("CONTENT", $overview2_tpl);
概述2.tpl:
<select name="HScorer1" style="width: 20%;">
<option value ="{$MYTEAMID}" >{$MYTEAM}</option>
</select>
类.team.php:
var $myteam;
var $myteamid;
$test=$_SESSION['tid'];
function team_class($id, $league){
global $db;
$sql = "SELECT * FROM l1_player where team_id='$test'";
$mytmp = $db->query_first($sql);
$this->myteam = $mytmp['player_2name'];
$this->myteamid = $mytmp['player_id'];
}
该表包含多行,其中 team_id=$test 带有 player_2name 和 player_id 但在选项/组合框中它只显示一个名称,无论如何我可以让它显示所有值?