初学php,不知道怎么样读取数据库数据,帮忙! 数据库localhost,用户名root,密码为空 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?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}?> 建议初学者把php和mysql手册先看了再说 难倒300人的PHP问题(discuz) 大家好,今天开始我也走上了php之路了 请问如何输出16进制? 关于register_shutdown_function 讨论并请教一个搜索功能,用户输入一个或一组关键字,怎么样将越接近的结果显示在越上面。即搜索结果相关性排序。 敏感词汇过滤 各位大哥帮我看一下我该怎么写mod_rewrite阿??? 我上传的文件怎么看到???求助,谢谢! 怎样用PHP发邮件?(windows2000 server) 小白求资源 PHP菜菜求助 session和cookie
$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
}
?>