I am using a tpl system with smarty, when I try to make a combo box have multiple selections I only get the option to choose one even though there are more than one values in the query.
Overview2.php:
$smarty->assign("MYTEAM", $team->myteam);
$smarty->assign("MYTEAMID", $team->myteamid);
$overview2_tpl = $smarty->fetch("overview2.tpl");
$smarty->assign("CONTENT", $overview2_tpl);
Overview2.tpl:
<select name="HScorer1" style="width: 20%;">
<option value ="{$MYTEAMID}" >{$MYTEAM}</option>
</select>
class.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'];
}
The table contains multiple rows where team_id=$test with player_2name and player_id
but in the option/combo box it only shows one name, anyway i can make it so all the values show?
Not a huge SMARTY expert, but it would make sense if
$db->query_firstonly returned the first row of the resultset. You’re probably looking for a different method.