Skip to content

Instantly share code, notes, and snippets.

@zsmynl
Created February 6, 2014 20:25
Show Gist options
  • Save zsmynl/8851847 to your computer and use it in GitHub Desktop.
Save zsmynl/8851847 to your computer and use it in GitHub Desktop.
调试服务器环境常用测试
<?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