如何使用mysql_fetch_array的结果呢? [英] How to use the result of mysql_fetch_array?
本文介绍了如何使用mysql_fetch_array的结果呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用这个while语句,我可以附和每排精即
I'm using a while statement on this and I can echo each row fine i.e
echo $row['myrow'];
但我要的是有结果投入像这样的链接:
but what I want is to have the result put into a link like so:
echo "<img src='http://www.mysite.com/images/$row['myrow'].jpg'>";
但它不工作。我在做什么错了?
But it doesn't work. What am I doing wrong?
推荐答案
要么呼应这种方式:
echo "<img src='http://www.mysite.com/images/{$row['myrow']}.jpg'>";
或者,恕我直言好多了,是这样的:
Or, IMHO much better, this way:
echo "<img src='http://www.mysite.com/images/".$row['myrow'].".jpg'>";
这给了文档双引号串的快速刷新。
这篇关于如何使用mysql_fetch_array的结果呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文