【发布时间】:2015-09-10 13:00:54
【问题描述】:
view.php
$result = mysqli_query($conn, "SELECT * FROM insgroup WHERE insID = '".$_SESSION['insID']."' ") or die ("Error selecting group from sessions:".mysqli_error($conn));
echo "<table border='1' cellpadding='10'>";
echo "<tr><th>Group ID</th><th>Group Name</th><th>Group Description</th><th>Group Subject</th><th>Group Department</th><th>Group Owner</th><th>Group Section</th><th>Group Year Level</th></tr>";
while($row=mysqli_fetch_array($result))
{
// set up a row for each record
echo "<tr>";
echo "<td>" . $row['groupid'] . "</td>";
echo "<td><a class='group-name' name='group-home-redirect' href='grouphome.php' >" . $row['groupname'] . "</a></td>";
echo "<td>" . $row['groupdesc'] . "</td>";
echo "<td>" . $row['groupsubject'] . "</td>";
echo "<td>" . $row['groupdept'] . "</td>";
echo "<td>" . $row['groupowner'] . "</td>";
echo "<td>" . $row['groupsection'] . "</td>";
echo "<td>" . $row['groupyearlevel'] . "</td>";
echo "<td><a name='delete-grp-btn' href='editgroup.php?id=" . $row['groupid'] . "'>Edit Group</a></td>";
echo "<td><a href='deletegroup.php?id=" . $row['groupid'] . "'>Delete Group</a></td>";
echo "</tr>";
}
echo "</table><br><br><NOSCRIPT><FONT COLOR='#FF0000'><BR>Javascript is required to access this area. Yours seems to be disabled.</FONT></NOSCRIPT> ";
if($result === FALSE){
echo "<script type='text/javascript'>alert('No rows for instructor' ".$_SESSION['insfname']." .".$_SESSION['inslname']." 'to be displayed.');</script>";
}
该链接名为“group-home-redirect”。当我创建一个组时,我想显示在视图表中,如果用户单击组名,数据库中该组的值可能会自动使用会话调用。天哪,我真的不知道,
【问题讨论】:
-
什么?你能澄清一下你想要达到的目标吗?有点混乱。
-
这是什么意思:"如果用户点击组名,将自动调用数据库中该组的值" ?
-
@CodeGodie,抱歉有点混乱,我只想为视图表中的特定组名创建一个链接,如果用户单击 href 链接,这些行表值会自动该“组”将被发送到另一个页面并在 grouphome.php 中发布信息。
-
在这种情况下,我同意下面@Julio 的回答。