inserting radio button in php page
I have retrieved the database details from a database to a php page. i have actually retrieved a specific column of a query. but i am not able to add the radio buttons to the retrieved values. Following is my coding:
<?php
$query = "SELECT url FROM开发者_开发知识库 measurementurl";
$result = mysql_query($query);
while($row = mysql_fetch_row($result))
{
$url = $row[0];
echo "url :$url <br>" ;
}
?>
Try this:
<form action="">
<?php
$query = "SELECT url FROM measurementurl";
$result = mysql_query($query);
while($row = mysql_fetch_row($result))
{
//$url = $row[0]; removed cause not used in code
echo "<input type=\"radio\" name=\"url\" value=\"$row[0]\" />$row[0]<br />";
}
?>
</form>
精彩评论