I am reading some rows from mysql to create a group of radio buttons. I need to write the name of the player two times, first as a value attribute and second the second time as a text. I don't understand why the same code ($players[$x]) produces two different values in the output html. This is the php code:
$players = readSqlFromMySql("select name from players");
for($x = 0; $x < count($players); $x++) {
echo('<input type="radio" name="radio-choice-v-2" value="' .
$players[$x] . '" id="name-choice-' . chr(66 + $x) . '" ><label
for="name-choice-' . chr(66 + $x) . '">' . $players[$x] . '</label>');
}
This is the rendered output html:
<input type="radio" name="radio-choice-v-2" value="<td style='width:150px;border:1px solid black;'>Amie</td>" id="name-choice-B">
So the first time, the variable's output is "td style=...", wheareas the second time it shows the expected value ("Amie"). What's going on? Is it php? jquery? jquerymobile? I am using XAMPP.
Thanks