Created
February 6, 2014 20:25
-
-
Save zsmynl/8851847 to your computer and use it in GitHub Desktop.
调试服务器环境常用测试
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
$con=mysql_connect('localhost','root','')or die('数据库连接失败'); | |
$db=mysql_select_db('test',$con); | |
$sql="SELECT name FROM user"; | |
$query=mysql_query($sql,$con); | |
while ($row=mysql_fetch_assoc($query)) { | |
$list[]=$row; | |
} | |
foreach ($list as $k => $v) { | |
echo $list[$k]['name']."<br/>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment