超简单数据库连接和查询

$db_apply = mysql_connect("localhost:3306", "root", "");
$table_apply=mysql_select_db("apply",$db_apply); 
$sql = "select * from ecs_apply";
$res = mysql_query($sql,$db_apply);
$rows=mysql_fetch_row($res);

显示:
Array
(
[0] => 1
[1] => 撒旦法
[2] => asdf
[3] => asdf
[4] => asdf
[5] => asdf
[6] => asdfasdf
[7] => 2013-10-11 16:14:47
)

你可能感兴趣的:(超简单数据库连接和查询)