如何使用锚标记将信息从一个页面发送到另一个页面,并在php中从数据库中获取数据


how to send information form one page to another page using anchor tag and fetch data from database in php

page1

<?php 
                            mysql_connect("localhost","root","");
mysql_select_db("mydatabase");
$sql="SELECT * FROM user";
$result=mysql_query($sql);
                            while($row=mysql_fetch_array($result))                          {
echo '<a  href="user_profile.php?variableName="'.&row['userid'].' style="text-decoration:none">'.$row['username'].'</a></form>';
}
?>

用户_文件页面

<?php
mysql_connect("localhost","root","");
mysql_select_db("mydatabase");
$sql="SELECT * FROM user where userid=".$_GET['variableName'];
$result=mysql_query($sql);
                            while($row=mysql_fetch_array($result))                          {
echo 'username:'.$row['name'];
}
?>

这是正确的方式还是不正确,如果是正确的,为什么不起作用,我面临着将信息发送到另一个页面的问题。如果这不是正确的方法,请建议我…我需要你的帮助。

我不是在谈论语法错误请参阅我的代码,并尝试知道我想要的是什么

看起来href属性可能没有用双引号终止。。。

"-位置不好

<a  href="user_profile.php?variableName='.&row['userid'].'"...