How to bring array value in Select tag PHP
Posted: Tue Aug 01, 2006 6:51 am
Pimptastic | Please use
i am getting error like :
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in d:\root\Site\multiple\multiple_entry.php on line 26
I want to check the syntax
is it right ?
thanx n advance
Regards
Bahru
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
i have one array called $Arr_Sal_Unit, i want to show this in Select Tag,Code: Select all
<?
$Currency_List = "";
for($incr=0;$incr<count($Arr_Sal_Unit);$incr++){
if ($post_j_sal_unit == $incr){
$Currency_List = $Currency_List."<option value=""".$incr.""" Selected>".$Arr_Sal_Unit($incr)."</option>";
}
else{
$Currency_List = $Currency_List."<option value=""".$incr.""" Selected>".$Arr_Sal_Unit($incr)."</option>"
}
}
?>
i just mention $Currency_List in the HTML part like
<html >
< tr>
<td>Salary</td>
<td><select name="j_sal_unit">
<? echo $Currenty_List; ?>
</select> <input type="text" name="j_sal" value="<?php echo $post_j_sal; ?>"></td>
</tr>
</html>Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in d:\root\Site\multiple\multiple_entry.php on line 26
I want to check the syntax
Code: Select all
$Currency_List = $Currency_List."<option value=""".$incr.""" Selected>".$Arr_Sal_Unit($incr)."</option>";thanx n advance
Regards
Bahru
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]