[英]How print data from a mySQL database using HTML/PHP
I have been trying to load data from a SQL database but with each bit more of research, I get more confused.我一直在尝试从 SQL 数据库中加载数据,但是随着研究的深入,我变得更加困惑。 I have been trying to get the data to show but clicking a button and being shown on another webpage but I have only been able to successfully load HTML webpages.我一直试图让数据显示,但单击一个按钮并显示在另一个网页上,但我只能成功加载 HTML 网页。 I have only been able to load a webpage that uses PHP and pulls data from the main page but I don't know how to do it in any other circumstance.我只能加载一个使用 PHP 并从主页提取数据的网页,但我不知道在任何其他情况下如何操作。 I only really know how to connect to the SQL database and that's it.我只知道如何连接到 SQL 数据库,仅此而已。 I am completely lost on what I am doing since there seems to be a variety of methods which I neither understand or can get to work.我完全迷失在我正在做的事情上,因为似乎有很多我既不理解也无法发挥作用的方法。 Any advice is appreciated, thanks!任何建议表示赞赏,谢谢!
There are lots of ways you can load content on a page.您可以通过多种方式在页面上加载内容。 It really comes down to your specific case.这真的取决于你的具体情况。
Typically starting with PHP to pull content from a database and show on a page is a good starting point.通常从 PHP 开始从数据库中提取内容并显示在页面上是一个很好的起点。
Moving beyond that I'd suggest looking into loading content once a page is loaded or on button click using jQuery.除此之外,我建议在加载页面或单击按钮后使用 jQuery 研究加载内容。
Check out this starter guide: https://www.yogihosting.com/jquery-load/查看此入门指南: https://www.yogihosting.com/jquery-load/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.