是否可以将数据库中的信息作为链接回显,我尝试了下面的代码,但出现解析错误。有没有其他方法可以做到这一点。谢谢
<?php
session_start();
if(isset($_SESSION['email'])){
$connect = mysql_connect("localhost","root","") or die("Couldn't connect!");
mysql_select_db("test") or die("Couldn't find database");
$email=$_SESSION['email'];
$sql = mysql_query("SELECT * FROM users WHERE email='$email'");
$info = mysql_fetch_assoc($sql);
echo"<a href='home.php'> $info['firstname']</a>"
}
?>