//getting values from dataBase
$sql = "SELECT `email` , `password` FROM `user_inf`";
// Execute query
$result = mysql_query($sql,$con);
$email;
$pass;
while($row = mysql_fetch_array($result))
{
$email = $row['email'];
$pass = $row['password'];
}
// create a dummy array
$doc = array (
1 => array ("Email", "Password")
array ($email, $pass),
);
我需要动态填充该数组“doc”。我从数据库中获取的值并使用该while循环获取。我想将所有这些值放入该数组中