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 找一个网络防御专家,外包的
  • ¥100 能不能让两张不同的图片md5值一样,(有尝)
  • ¥15 informer代码训练自己的数据集,改参数怎么改
  • ¥15 请看一下,学校实验要求,我需要具体代码
  • ¥50 pc微信3.6.0.18不能登陆 有偿解决问题
  • ¥20 MATLAB绘制两隐函数曲面的交线
  • ¥15 求TYPCE母转母转接头24PIN线路板图
  • ¥100 国外网络搭建,有偿交流
  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案