本人刚开始学习PHP
$con = mysql_connect("127.0.0.1","root","root");
if(!con){
die('Could not connect:'.mysql_error());
}else{
mysql_select_db("test",$con);
$result = mysql_query("select * from user");
echo "
| " . count($row) . " | ";" . $row[0] . " | ";" . $row[1] . " | ";" . $row[2] . " | ";
mysql_close($con);
}
?>
我的数据库中就只有id,username,pwd3个字段为什么
echo "
------解决方案--------------------
请认真阅读手册!
mysql_fetch_array -- 从结果集中取得一行作为关联数组,或数字数组,或二者兼有
------解决方案--------------------
echo "
| " . $row[0] . " | ";" . $row[1] . " | ";" . $row[2] . " | ";
| " . mysql_num_rows($result) . " |