douhao9203 2015-04-29 07:54
浏览 34
已采纳

将mysql行添加到表中的href结尾

I am trying to add the content of a cell in a mysql row at the end of href in a table

This works without the row being added to the end of the href. Its a while loop so I wrapped the whole loop in a php bracket

echo "<td><a href=\"https://website/call?\">" . $row['TXID'] . "</a></td>";

But when I try to add in the "TXID" it errors out and the page doesnt load. I have tried a few solutions on here which lead me to escaping the \" for the href but im not sure why it isnt working.

echo "<td><a href=\"https://website/call?' . $row['TXID'] . '\">" . $row['TXID'] . "</a></td>";

Is it just my syntax that is wrong or am I missing something?

I apologize if this is a duplicate. I couldnt find anything for this exact situation that worked for me.

  • 写回答

3条回答 默认 最新

  • duanjiang7505 2015-04-29 08:00
    关注

    you have syntax error try this

    echo "<td><a href='https://website/call?{$row['TXID']} '>" . $row['TXID'] . "</a></td>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥15 关于超局变量获取查询的问题
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集
  • ¥15 在启动roslaunch时出现如下问题
  • ¥15 汇编语言实现加减法计算器的功能
  • ¥20 关于多单片机模块化的一些问题