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 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。