Forum Moderators: open
i am making an ajax application, in which i call a PHP page that run a query on MySQL DB and return the output.
now the number of rows can range from 1 to 20. I want to display radio buttons based on the number of rows returned from the MySQL query.
On HTML page i get all the values properly like number of rows and available data the only problem is I am just unable to make any logic to display the radio buttons equal to the number of rows return.
this line gives me output,
Code:
var res = results.split('¦')
res[0] = number of rows returned
and rest has the data returned for each row
any idea how to do it?
thanks
I'm not sure exactly what you are trying to accomplish, but it seems like it should be something like this, in PHP:
while($row = mysql_fetch_array($result)) {
echo '<input type="radio" value="'.$row['col'].'" name="info[]" /><br />';
}
Hope this helps.
Good luck!