Notice: Undefined variable: CONTENT in D:\wamp64\www\demo\index.php on line 67 10
<divid="content"><?phpecho"<table>";echo"<tr>";echo"<td>标题";echo"</td>";echo"<td>";ec...
<div id="content">
<?php
echo "<table>";
echo "<tr>";
echo "<td >标题";
echo "</td>";
echo "<td>";
echo "发贴人";
echo "</td>";
echo "</tr>";
$con = mysql_connect("localhost","root","pwd123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("message", $con);
$result = mysql_query("SELECT * FROM news where isTrue=1");
while($row = mysql_fetch_row($result))
{
$title=$row[1];
if(strlen($content)>10)/*第67行*/
{
$title= substr($title,0,10)."...";
}
echo "<tr><td><a href='content.php?id=$row[0]'>$title</a></td>
<td>$row[5]</td>
</tr>";
}
mysql_close($con);
echo "</table>";
?>
</div> 展开
<?php
echo "<table>";
echo "<tr>";
echo "<td >标题";
echo "</td>";
echo "<td>";
echo "发贴人";
echo "</td>";
echo "</tr>";
$con = mysql_connect("localhost","root","pwd123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("message", $con);
$result = mysql_query("SELECT * FROM news where isTrue=1");
while($row = mysql_fetch_row($result))
{
$title=$row[1];
if(strlen($content)>10)/*第67行*/
{
$title= substr($title,0,10)."...";
}
echo "<tr><td><a href='content.php?id=$row[0]'>$title</a></td>
<td>$row[5]</td>
</tr>";
}
mysql_close($con);
echo "</table>";
?>
</div> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询