简体   繁体   English

如何将数据库中的信息插入到我的网站上的php / display中?

[英]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.

相关问题 我在从php文件中的应用程序接收注册信息时遇到麻烦,无法将该信息插入MSQL数据库中 - I'm having trouble receiving the registration information from the app in my php file to insert that information into the MSQL database 如何显示信息从我的数据库到html表? - How to display information from my database to html table? 无法从我的 Laravel 网站显示数据库 - Not able to display database from my laravel website 使用MySQLI如何显示网站上数据库中的数据 - Using MySQLI how can I display data from my database on my website 如何在我的数据库中显示PHP页面上的图像? - How to display images on PHP page from my database? 如何显示数据库中的图像? (php) - How do i display images from my database? (php) 如何从表单中获取信息以使用XAMPP插入mySQL数据库? - How do I get the information from my form to insert into a mySQL database using XAMPP? 将数据从 googlesheets 插入我的网站(使用 PHP)? - Insert data from googlesheets to my website (using PHP)? 如何使用php从网站上的mysql数据库提供信息 - how to provide information from a mysql database on a website using php 有没有一种方法可以从数据库中的嵌入式URL在我的网站上显示vimeo视频? - Is there a way to display vimeo videos on my website from embedded url in database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM