[英]How to insert information from database into my php/display on my website?
All my information is going into the database that is being saved but I want it to come back up when I log in using a unique email. 我所有的信息都将进入保存的数据库中,但是当我使用唯一的电子邮件登录时,我希望它能重新出现。 I have tried a lot of different codes within php. 我在php中尝试了很多不同的代码。 This is what I recently tried. 这是我最近尝试过的。
$result_habit = mysqli_query ($con, $query_habit);
if (mysqli_num_rows($result_habit) ==1) {
echo "found the row for ", $Email;
$row = mysqli_fetch_row($result_habit);
echo "$row[c1]"
I want it to display the information from the table 'habit' and each row is labeled c1, c2, c3, etc Is there anything else I have to do to get the saved data to display for each unique login email? 我希望它显示表“ habit”中的信息,并且每一行都标记为c1,c2,c3等。我还需要做其他事情来获取保存的数据以显示每个唯一的登录电子邮件吗? thanks 谢谢
$result_habit = mysqli_query ($con, $query_habit);
if (mysqli_num_rows($result_habit) == 1) {
echo "found the row for ", $Email;
$row = mysqli_fetch_row($result_habit);
echo $row['c1'];
}
This should be the correct way to write the code. 这应该是编写代码的正确方法。 All you seemed to have missed was a closing bracket and echoing the row variable correctly. 您似乎所错过的只是右括号,并正确地回显了row变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.