如何从MySQL中的记录中建立链接? [英] how to make a link from the records in mysql?
问题描述
我在这里显示记录表单数据库的代码..我想要的是,我想使用户名链接,当我点击链接的用户名,它会打开一个新的窗口..可以有人请帮助我与它..因为我试图从互联网上搜索,但它不工作..
I have here the code for displaying the records form database..what i want is that i want to make the username a link,and when i click the link username it will open a new window..can somebody please help me with it..because i tried to search from the internet but it not working..
继承人代码
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(this)的代码
函数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 = no')
}
function 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=no') }
推荐答案
请发布
Please post the Javascript code for
pop_up(this)
如果任何为js方法下的新窗口编写的代码,然后删除
If any codes written for new window under js method then remove
目标=_ blank
target="_blank"
包含在锚标记中。
这篇关于如何从MySQL中的记录中建立链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!