我想把它们输出到一个表中
谢谢如果有人能帮我我正在学习php。
我正在学习做一个链接管理,它使用php和mysql。如果有人能推荐源代码,我将非常感谢。
<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("abc", $con);
$result = mysql_query("SELECT * FROM links");
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><a href='{$row[Link]}'>{$row[Name]}</a></td>" ;
echo "</tr>";
}
?>
1条答案
按热度按时间qoefvg9y1#
你的引号到处都是,双引号将用于开始和停止字符串如果你用他们开始,但你也有引号轮
<a>
标记时,如果数组中有双引号,也可以省略数组索引周围的引号,因此可以使用。。。或者,如果你想坚持使用双引号,你需要摆脱内在的双引号。。。