从数据库掉不出数据.. 先把这一句改成:$result=mysql_query($query) or die(mysql_error());然后把错误代码贴出来让大家看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 目前库存图书:"; echo""; echo" "; echo" id " " name " " author " " classname " " edtidate " " "; while ($r=mysql_fetch_array($result)) { $name=$r["name"]; $author=$["author"]; $id=$r["id"]; $classname=$r["classname"]; $editdate=$r["editdate"]; echo" "; echo" $name "; echo" $author "; echo" $id "; echo" $classname "; echo" $editdate "; echo""; } echo" "; echo""; ?> 返回改成第一种显示 $result=mysql_query("$query",$con);改为$result=mysql_query($query,$con);试试 试试下面的。$con=mysql_connect("localhost","root","1234");mysql_select_db("tushu");$query="select * from tpl";$result=mysql_query($query,$con);$rownumber=mysql_num_rows($result);echo "<center>";echo "<table border='1'><tr>";echo "<td align=center> id </td> <td align=center> name </td> <td align=center> author </td> <td align=center> classname </td> <td align=center> edtidate </td> </tr>";while ($r=mysql_fetch_array($result)){ echo"<tr>"; echo"<td align='left'><font size='2'>".$r['name']."</font></td>"; echo"<td align='left'><font size='2'>".$r['author']."</font></td>"; echo"<td align='left'><font size='2'>".$r['id']."</font></td>"; echo"<td align='left'><font size='2'>".$r['classname']."</font></td>"; echo"<td align='left'><font size='2'>".$r['editdate']."</font></td>"; echo"</tr>";}echo"</table>"; 你用mysql客户端连一下数据库,输select * from library;看有没有输出。 我在dos下输入select * from library能显出数据. php 文件中有一段排序功能,如何应用? php中cookie和session是怎么样的啊? 正则去掉空格 怎样判断数据库中是否有某一id?(id是主键) 上传的进度条??(在线等待。。。) 急急!!请教文本显示问题 用PHP怎么实现手机短信发送!! Apche+php的安装问题 在PHP中类有没有稀构函数? 帮一下忙好吗??应该有的挑战性的哦!! php怎么样连接sql数据库? 我调用MYSQL出错啦帮帮我,搞不定呀。
"; echo" id " " name " " author " " classname " " edtidate " "
"; while ($r=mysql_fetch_array($result)) { $name=$r["name"]; $author=$["author"]; $id=$r["id"]; $classname=$r["classname"]; $editdate=$r["editdate"]; echo" "; echo" $name "; echo" $author "; echo" $id "; echo" $classname "; echo" $editdate "; echo""; } echo"
"; echo""; ?>
返回改成第一种显示
$con=mysql_connect("localhost","root","1234");
mysql_select_db("tushu");
$query="select * from tpl";
$result=mysql_query($query,$con);
$rownumber=mysql_num_rows($result);
echo "<center>";
echo "<table border='1'><tr>";
echo "<td align=center> id </td>
<td align=center> name </td>
<td align=center> author </td>
<td align=center> classname </td>
<td align=center> edtidate </td>
</tr>";
while ($r=mysql_fetch_array($result))
{
echo"<tr>";
echo"<td align='left'><font size='2'>".$r['name']."</font></td>";
echo"<td align='left'><font size='2'>".$r['author']."</font></td>";
echo"<td align='left'><font size='2'>".$r['id']."</font></td>";
echo"<td align='left'><font size='2'>".$r['classname']."</font></td>";
echo"<td align='left'><font size='2'>".$r['editdate']."</font></td>";
echo"</tr>";
}
echo"</table>";