If I am fetching data from a MySQL database and using a while loop to iterate through the data how would I add each one to array?
$result = mysql_query(\"SEL
If you have multiple columns in your Departments table and you want to save in different array.
$result = mysql_query("SELECT * FROM `Departments`");
$dept_id = array();
$dept_name=array();
while($row = mysql_fetch_assoc($result))
{
//fetches and store all results in id column on your departments table
$dept_id= $row['id'];
//fetches and store all results in name column on your departments table
$dept_name=$row['name'];
}