我想从我的数据库中检索用户的信息。到目前为止,我的代码如下所示:
<?php
$database="myweekdatabase";
$con = mysql_connect("localhost","root" ,"");//for wamp 3rd feild is balnk
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$database", $con);
$User = $_SESSION['Email']; //Uses the email for the current user logged in
$query = "SELECT * FROM myweekprofiles WHERE Email = '$User' ";
$result = mysql_query($query);
?>
这是我的 HTML 代码:
<h3>Edit Your Profile</h3>
<?php echo "<h3>" .$result; "</h3>" ?>
到目前为止,这是我的输出:
Resource id #5
为什么我把它作为输出?