数据库localhost,用户名root,密码为空

解决方案 »

  1.   

    <?php
    $mylink=mysql_connect("localhost","root","1234");
    $sql="SELECT id,name from 表名";
    $result_output=mysql_query($sql,$mylink);
    if(mysql_num_rows($result_output)>0){
    ?>
    <table width="75%" border="1">
    <?php
       while($array_yh=mysql_fetch_array($result_output)){
    ?>
          <tr> 
    <td><?php echo $array_yh['id'];?></td>
    <td><?php echo $array_yh['name'];?></td>
          </tr>
    <?php
      }
    ?>
    </table>
    <?php
    }
    ?>
      

  2.   

    建议初学者把php和mysql手册先看了再说