Home  >  Article  >  Backend Development  >  【PHP新手问题】想在同一页查询两张表内容输出

【PHP新手问题】想在同一页查询两张表内容输出

WBOY
WBOYOriginal
2016-06-23 13:38:29851browse

如题,新手问题,现在想做个博客,遇到个困难,由于在一个页面中,左侧栏目需要输出Type(博客类型),右侧内容需要输出INformational(博客内容),需要查询两张表并且输出,但是用while后一直报错,无法查询,求解?


回复讨论(解决方案)

放出代码。。

你112行直接用

标签,PHP解析是不认的,把那段html文本echo出来,
像“while($row=mysql_fetch_array($result)){
                                               echo "

  • ".$row['type_name']."
  • ";
                                                    }”
    这段一样

    你是怎么while的,是不是代码写错了

    你把html语言直接写入循环体肯定会报错的。

    同楼上 

    等标签PHP是不解析的 如果你要在脚本内输出 需要echo "

    "; 引号包起来  否则你就如同楼上 将脚本嵌入页面中

    多谢各位啊,新手,疏忽了,已经改好了!

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn