I have a php code like this:
$categories_query = tep_db_query("select categories_id, categories_name from categories order by categories_name");
while ($categories = mysql_fetch_array($categories_query)) {
$categories_array[] = array('id' => $categories['categories_id'], 'text' => $categories['categories_name']);
}
question is how can I replace the while loop with for example foreach so I can first fetch mysql array, then I want to edit some values and then pass it on to a loop? I tried different versions of loops but they don't give me the same result as the while loop does.