我想知道是否有人能够帮助我。单选按钮列表
我正在使用下面的代码构造一个单选按钮作为选择每一行数据的方式。
<?php
mysql_connect("hostname", "username", "password")or
die(mysql_error());
mysql_select_db("database");
$result = mysql_query("SELECT userdetails.userid, finds.userid, finds.locationid, detectinglocations.locationid, detectinglocations.locationname, finds.dateoftrip, finds.findname, finds.finddescription FROM userdetails, finds, detectinglocations WHERE finds.userid=userdetails.userid AND finds.locationid=detectinglocations.locationid AND finds.userid = 1");
if (mysql_num_rows($result) == 0)
// table is empty
echo 'There are currently no finds recorded for this location.';
echo"<table>\n";
while (list($userid, $dateoftrip) =
mysql_fetch_row($result))
{
echo"<tr>\n"
.
"<td><input type='radio' name='radio' dateoftrip, value='{$userid}' /></td>\n"
."<td><small>{$dateoftrip}</small><td>\n"
."</tr>\n";
}
echo"<tr><td colspan=\"3\">";
echo"<br>";
echo"</td></tr>";
echo'</table>';
?>
我可以管理来构建列表中,但旁边的单选按钮的值是“用户ID”,而我期待把“dateoftrip”对每个单选按钮。
我一直在这个工作了一段时间,我看不到我的错误在哪里。
我只是想知道是否有人可以看看这个请让我知道我要去哪里错了。
非常感谢
你好,非常感谢你帮我完成这个。不胜感激。 – IRHM 2012-02-22 14:17:34