dongliuzhuan1219 2014-08-31 18:20
浏览 47
已采纳

PHP回显结果成表[关闭]

I am struggling to put the data that is pulled from my database into a table layout.

This is the echo result:

echo "<p><h3>".$results['ID Number']."</h3>".$results['id_number']."</p>";
            echo "<p><h3>".$results['Card Status']."</h3>".$results['card_status']."</p>";
            echo "<p><h3>".$results['Full Name']."</h3>".$results['full_name']."</p>";
            echo "<p><h3>".$results['DBS/CRB Number']."</h3>".$results['dbs_number']."</p>";
            echo "<p><h3>".$results['Job Title']."</h3>".$results['job_title']."</p>";
            echo "<p><h3>".$results['Card Start Date']."</h3>".$results['card_start_date']."</p>";
            echo "<p><h3>".$results['Card Expiry']."</h3>".$results['card_expiry_date']."</p>";
            echo "<img src='photos/".$results['photo_name']."'>";

Please can someone help me, its driving me crazy, also the Name of the result isn't showing, e.g. 'ID Number' as a title then 'id_number' result.

or is there an easier way to show all the data from the record rather than having multiple echo's

I have a search box to find a record matching the id_number and then the data connected to a id_number is then shown

  • 写回答

2条回答 默认 最新

  • dongwuge6201 2014-08-31 18:34
    关注

    Well I dont think there was any help needed , still for the sake of your blockade use this as

    echo "<table><tr><td><h3>ID Number</h3></td><td>".$results['id_number']."</td></tr>";
                    echo "<tr><td><h3>Card Status</h3></td><td>".$results['card_status']."</td></tr>";
                    echo "<tr><td><h3>Full Name</h3></td><td>".$results['full_name']."</td></tr>";
                    echo "<tr><td><h3>DBS/CRB Number</h3></td><td>".$results['dbs_number']."</td></tr>";
                    echo "<tr><td><h3>Job Title</h3></td><td>".$results['job_title']."</td></tr>";
                    echo "<tr><td><h3>Card Start Date</h3></td><td>".$results['card_start_date']."</td></tr>";
                    echo "<tr><td><h3>Card Expiry</h3></td><td>".$results['card_expiry_date']."</td></tr>";
                    echo "<tr><td></td><td><img src='photos/".$results['photo_name']."'></td></tr></table>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊