【PHP新手问题】想在同一页查询两张表内容输出
如题,新手问题,现在想做个博客,遇到个困难,由于在一个页面中,左侧栏目需要输出Type(博客类型),右侧内容需要输出INformational(博客内容),需要查询两张表并且输出,但是用while后一直报错,无法查询,求解?
------解决思路----------------------
你112行直接用
标签,php解析是不认的,把那段html文本echo出来,
像“while($row=mysql_fetch_array($result)){
echo "
}”
这段一样
------解决思路----------------------
<br> <?php<br> while($r=mysql_fetch_array($result1)){<br> <p><strong>所有日志 <small>[1033]</small></strong></p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p><br> <h3><strong>[置顶]<span class="text-danger">$r['tb_blog_title']</span>!</strong></h3><br> <small class="text-muted">$r['tb_blog_date']</small><br> <br><br> <h2>$r['tb_blog_title']</h2><br> <h4>$r['tb_blog_user']</h4><br> <p>$r['tb_blog_content']</p><br> <small class="text-danger"><a href="#">阅读全文>></a> </small><br> <br><br> <p class="text-warning"><a href="#">分类:$r['tb_blog_type'] </a> <br><font color="#FF8000">------解决思路----------------------</font><br><a href="#"> 阅读(20101) </a> <br><font color="#FF8000">------解决思路----------------------</font><br> <a href="#"> 评论(10)</a> </p><br> }<br> <br> ?><br> </div><br>修改为
<br><?php<br> while($r=mysql_fetch_array($result1)){ ?><br> <p><strong>所有日志 <small>[1033]</small></strong></p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p><br> <h3><strong>[置顶]<span class="text-danger"><?php echo $r['tb_blog_title']; ?></span>!</strong></h3><br> <small class="text-muted"><?php echo $r['tb_blog_date']; ?></small><br> <br><br> <h2><?php echo $r['tb_blog_title']; ?></h2><br> <h4><?php echo $r['tb_blog_user']; ?></h4><br> <p><?php echo $r['tb_blog_content']; ?></p><br> <small class="text-danger"><a href="#">阅读全文>></a> </small><br> <br><br> <p class="text-warning"><a href="#">分类:<?php echo $r['tb_blog_type']; ?> </a> <br><font color="#FF8000">------解决思路----------------------</font><br><a href="#"> 阅读(20101) </a> <br><font color="#FF8000">------解决思路----------------------</font><br> <a href="#"> 评论(10)</a> </p><br> <?php<br> }<br> <br> ?><br></div><br>











