先把这一句改成:
$result=mysql_query($query) or die(mysql_error());
然后把错误代码贴出来让大家看看

解决方案 »

  1.   

    目前库存图书:"; 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""; ?> 
       返回改成第一种显示
      

  2.   

    $result=mysql_query("$query",$con);改为$result=mysql_query($query,$con);试试
      

  3.   

    试试下面的。
    $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>";
      

  4.   

    你用mysql客户端连一下数据库,输select * from library;看有没有输出。
      

  5.   

    我在dos下输入select * from library能显出数据.