我在這裏顯示記錄表單數據庫的代碼..我想要的是,我想使用戶名鏈接,當我點擊鏈接的用戶名,它會打開一個新的窗口..可以有人請幫助我it..because我試圖從互聯網上搜索,但它不工作..如何使mysql中的記錄鏈接?
繼承人的代碼
public function dataview($query)
{
$stmt = $this->db->prepare($query);
$stmt->execute();
if($stmt->rowCount()>0)
{
while($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td> ".$row['user_id']." </td>";
echo "<td> ".$row['username']." </td>";
echo "<td> ".$row['password']." </td>";
echo '<td><a style="float:left" href="VIEWSAMPLE.PHP?user_id=' . $row["user_id"] . '>'.$row["username"].'"<input name="image" type="image" value="edit"><image src="image/EDIT.png" class="img-responsive" width="25px"></a>
<a style="float:left" href="delete.php?user_id=' . $row["user_id"] . '>" <input name="image" type="image" value="delete" onclick="return confirm(\'are you sure?\')"><image src="image/DELETE.png" class="img-responsive" width="25px"> </a></td>';
echo "</tr>";
}
}
else
{
echo "<tr>";
"<td>Nothing here...</td>";
"</tr>";
}
}
}
?>
這裏是POP_UP代碼(本)
功能POP_UP (url){ window.open(url,'win2','status = no,toolbar = no,scrollbars = yes,titlebar = no,menubar = no,resizable = yes,width = 800,height = 600,directories = no,location =無') }
你有什麼試過?你說「它不工作」,所以你一定嘗試過一些東西。如果您發佈的代碼是您的嘗試,那麼您有哪些具體問題? 「它不工作」幾乎肯定是不夠的。 –
@WaiHaLee itried this code echo''.$row["username"].'';但問題是,當我點擊鏈接它打開一個新的窗口,但在同一時間,它也打開一個新的標籤.. –
這可能是因爲你同時使用JavaScript到'pop_up'一個新窗口** *和***'target =「_ blank」'這也*彈出一個新窗口...?! – deceze