简体   繁体   中英

Adding mysql row to end of href in a table

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.

请尝试这个。

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

This will work fine. Use some kind of IDE, so that all your syntax errors and typo will be eliminated at the time of typing.I use netbeans ide 8.It is super cool for developing php applications.

你有语法错误试试这个

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM