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]Code: Select all
<?
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$name=mysql_result($result,$i,"name");
$phone=mysql_result($result,$i,"phone");
$email=mysql_result($result,$i,"email");
?>
<td width="6025" rowspan="3" align="left"><p class="style1">Target:
<select name="select">
<? echo "<option value='$id'>$name</option>";?> <--------(want to add option here)
</select>
<td width="6025" rowspan="3" align="left"><p class="style1"Delete Target:
<select name="select">
<? echo "<option value='$id'>$name</option>";?> <--------(want to add option here)
</select>
<?
$i++;
}
?>Lets say with every line of results I draw out from MySQL and processed into variables with PHP.
How can I actively add a '<option value ='$id'> $name </option>' in the 2 places I want to everytime the loop hooks up?
I tried the above code which I written, it works, it does show all the $name with <options> but in the end it also shows all the unwanted HTML code. The segment between the 2 php sections is being looped many times as well. How can I skip that
feyd | 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]